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
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.
The text was updated successfully, but these errors were encountered:
I'm using the
{...starSettings}
method of passing props, one of which is theedit
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 fromtrue
tofalse
and vice versa (the state value that's assigned to theedit
prop), but this doesn't seem to affect the ReactStars component, since itsedit
prop stays at the initially rendered value.edit: After poking the code a bit more, changing all the occurrences of
config.edit
tothis.props.edit
fixes the issue. Not sure why, but there's something wrong with the way the state (and thereforeconfig
) is assigned values.The text was updated successfully, but these errors were encountered: