Change precedence in 'getResolvedState' (#166)

* Change precedence in 'getResolvedState'
  * Previously existing props would overwrite passed in state
  * Now passed in state gets precedence

* added a controlled table example to storybook
This commit is contained in:
Eric Abbott
2017-04-05 01:10:17 -06:00
committed by Tanner Linsley
parent 1f4c9afd2b
commit b779a98d7a
3 changed files with 158 additions and 1 deletions
+1 -1
View File
@@ -19,8 +19,8 @@ export default {
getResolvedState (props, state) {
const resolvedState = {
..._.compactObject(this.state),
..._.compactObject(state),
..._.compactObject(this.props),
..._.compactObject(state),
..._.compactObject(props)
}
return resolvedState