-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Sticky: active
prop doesn't reset sticky state
#2082
Comments
-this.state.rActive = bool
+this.setState({ rActive: bool}) Your component will never receive update in this case. Don't mutate React's state directly, use |
@layershifter ,thank you for the correction. I've made a simpler example to illustrate the problem: But when the sticky is active in default, and it's changed to inactive in the middle of sticking/scrolling, |
We should call also |
active
prop doesn't reset sticky state
Tried it, but componentWillReceiveProps() never gets called on the button click. https://codepen.io/anon/pen/RLWXpo |
PR was opened #2083. |
Steps
Create two sticky components , one on the left, and one on the right.
The right one should be inactive in default.
The left one has an
onStick
event to update the state to make the right sticky active.Expected Result
The right sticky should become
active
after the left sticky firesonStick
event.Actual Result
The
active
prop doesn't seem to update on state change. The right sticky remains inactive.Version
0.73.1
Testcase
https://codepen.io/anon/pen/xXwBxj (Invalid example, please read post 2)
The text was updated successfully, but these errors were encountered: