-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add componentWillReceiveProps to CellExpand #862
Conversation
testElement.simulate('click'); | ||
expect(testElement.state('expanded')).toBeTruthy(); | ||
let secondProps = getFakeProps(false); | ||
testElement = renderComponent(secondProps); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates a new component, use testElement.setProps
@@ -6,6 +6,9 @@ const CellExpand = React.createClass({ | |||
let expanded = this.props.expandableOptions && this.props.expandableOptions.expanded; | |||
return { expanded: expanded }; | |||
}, | |||
componentWillReceiveProps(nextProps) { | |||
this.setState(nextProps.props.expandableOptions && nextProps.props.expandableOptions.expanded); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this fancy thing?
Changes Unknown when pulling 001e9f5 on dm-fix-subrow-state into ** on master**. |
Changes Unknown when pulling 2992dc0 on dm-fix-subrow-state into ** on master**. |
Description
This PR will add componentWilLReceiveProps to CellExpand in order to update the state when receiving the *expanded" from external data.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior?
The subrow icon only changes with the click event.
What is the new behavior?
It will continue to change on the click event but also change when receiving the information by props.
Does this PR introduce a breaking change?