-
Notifications
You must be signed in to change notification settings - Fork 208
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
Add support for React.forwardRef and React.createRef #278
Conversation
Hi @Andarist, and thanks for the contribution! This looks good to me, but I'm a little behind on the latest React features. Can you explain this change a little better? Preferably in the commit message so that future devs can understand why the change was made. More specifically, it would help me if you could explain if this is a breaking change or not (semver major vs semver minor/patch). |
12b1a92
to
a1ff00d
Compare
I've added a short explanation to the commit message:
I can confirm that this change is backwards compatible. In the future (when doing a major release and dropping support for older React versions) you should dropping the |
Thanks! The only thing I need before merging this PR is an update to the Readme. Will you take care of that? |
I'll try to adjust it some time later. |
Components wrapped with `React.forwardRef` will now correctly have their refs passed to `react-waypoint` as they don't recognize custom `innerRef` prop, but should know what to do with received `ref` (that is - pass it to underlaying DOM element). Also the support for `React.createRef` has been added - which is a new React API, an alternative to callback refs. It returns an object with shape of `{ current: null }`, so the ref can and should be set on the `current` property (it's done by React internally when passingit as ref prop to an element).
a1ff00d
to
3960e0d
Compare
I've adjusted the PR with README change. |
Great! Thanks for the quick turnaround. |
Released in 8.1.0 |
No description provided.