-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
chore(gatsby-react-router-scroll): Remove legacy context #21626
Conversation
value={{ | ||
registerElement: this.registerElement, | ||
unregisterElement: this.unregisterElement, | ||
scrollBehavior: this.scrollBehavior, | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this re-render child components whenever this component re-renders?
because a new object instance passed on each render.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're right. Let me change to use this
This reverts commit 62625b9.
@herecydev This looks great! We're working on deciding a feature set and timeline for a v3. This is technically a major change as it breaks compatibility for consumers outside of that 16.3 range. Which ironically, this scroll container is used in more than just our codebase. I think that since this is here to satisfy some warnings, we're going to pause this PR and consider making it part of V3 |
Gatsby depends on React 16.4.3 so I published a major of this plugin as it's used internally in gatsby. Available in [email protected] |
Description
Replace legacy context with React 16.3 Context
Related Issues
Fixes #21231