You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Props updates are not based on the states of parent component, for instance:
this.setState({ user: 'test' }, () => { this.setState({ extra: "extra_info" }) }) ; ==> test is passed to child component; extra_info is not
It happens once i applied connect to the child component
export default ChildComponent; ==> this works fine
export default connect(mapStateToProps) ==> this causes the parent state not updated into child's props
What is the expected behavior?
Props and states are updating accordingly.
Also a site note here, the parent was a class component, while the child is function component with react hooks, was trying to further expand the project using hooks instead.
The text was updated successfully, but these errors were encountered:
The issue tracker here on GitHub is reserved for bug reports and feature requests. For usage questions (which is what I believe this is), please use our Discussions page, Stack Overflow, or Reactiflux where there are a lot more people ready to help you out. Thanks!
Please feel free to reply if you think this issue was closed prematurely.
What is the current behavior?
Props updates are not based on the states of parent component, for instance:
this.setState({ user: 'test' }, () => { this.setState({ extra: "extra_info" }) }) ; ==> test is passed to child component; extra_info is not
It happens once i applied connect to the child component
export default ChildComponent; ==> this works fine
export default connect(mapStateToProps) ==> this causes the parent state not updated into child's props
What is the expected behavior?
Props and states are updating accordingly.
Also a site note here, the parent was a class component, while the child is function component with react hooks, was trying to further expand the project using hooks instead.
The text was updated successfully, but these errors were encountered: