-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
getWrappedInstance() broken in ^8.0.0 #534
Comments
fully agree had no time yet to search for a solution...but yes...calling getWrappedInstance is no longer an options (out of the reasons you mention). So if i get your approach right - just passing in a innnerRef function as prop and use that on the ref in rendering |
Yeah, it doesn't even have to be a function; react 16.3+'s createRef object should do too. It's similar to the approach taken by styled-components/emotion. |
ok...will need to check that... |
Even better would be |
seems you know a lot more about refs then me 💪i just try to avoid them personally |
details for implementation: https://gist.github.com/gaearon/1a018a023347fe1c2476073330cc5509 |
landed in react-i18next@8.0.7 |
* react-dropzone * react-i18next * coudn't upgrade to v8 because of 'getWrappedInstance()` * i18next/react-i18next#534 * https://react.i18next.com/deprecated/translate-hoc * webpack-bundle-analyzer
The fix did fix Moving the |
@Kovensky should be in react-i18next@8.0.8 |
The documentation in the README specifies that you need to call
getWrappedInstance()
twice; however, neither of the new building blocks used internally bywithNamespaces
(withI18n
, which in turn useswithContext
) implementgetWrappedInstance()
. Even if they did, this would have required 3 chained calls ofgetWrappedInstance()
, not 2.A better approach would probably be to drop the
withRef
system entirely and have aninnerRef
prop that is forwarded asref
in the HOC'srender()
.The text was updated successfully, but these errors were encountered: