Skip to content
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

Component Props not updating if connect() is used #1718

Closed
jacky-ew opened this issue May 11, 2021 · 1 comment
Closed

Component Props not updating if connect() is used #1718

jacky-ew opened this issue May 11, 2021 · 1 comment

Comments

@jacky-ew
Copy link

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.

@timdorr
Copy link
Member

timdorr commented May 11, 2021

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.

@timdorr timdorr closed this as completed May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants