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 doesn't re-render when sent new props #13

Open
PAK90 opened this issue Jan 22, 2017 · 1 comment
Open

Component doesn't re-render when sent new props #13

PAK90 opened this issue Jan 22, 2017 · 1 comment

Comments

@PAK90
Copy link

PAK90 commented Jan 22, 2017

I'm using the {...starSettings} method of passing props, one of which is the edit prop. After manually fixing the edit override issue (#12), I expected it to re-render if I passed it a changed prop. In this case, it doesn't re-render, leaving it stuck in an edit true/false state until I refresh my page. From my understanding of react, if a prop changes, it should force a re-render? In the React tab of chrome dev tools, I can confirm that my state value changes from true to false and vice versa (the state value that's assigned to the edit prop), but this doesn't seem to affect the ReactStars component, since its edit prop stays at the initially rendered value.

edit: After poking the code a bit more, changing all the occurrences of config.edit to this.props.edit fixes the issue. Not sure why, but there's something wrong with the way the state (and therefore config) is assigned values.

@fedoryakubovich
Copy link
Contributor

#43

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