-
Notifications
You must be signed in to change notification settings - Fork 67
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
Deprecate withRef for innerRef #46
Conversation
Hi!
How can I get instance of Comp using |
Hi @klimashkin ! As you can see here we are just passing the This In the example you are explaining you would have access to the instance of the component created by anotherhoc like I'm going to write the change and an example during the afternoon. |
Thank you for attention, my question was asked to raise the same on your side : ) We need some convention among HOCs about I think hocs should have boolean option, for instance, How do you think? |
@javivelasco Do you copy? : ) What do you think? |
Sorry it took this long @klimashkin. Please check #59 I think it covers all use cases |
@javivelasco this is working fine for this project. but if i deploy this project and use as library into other project (like button component to my main project)then it always loaded default css instead of external css. thanks!!!! |
@HiirenP I created a set of modules, which are faster and don't require |
@klimashkin |
Since assigning string refs is going to be deprecated sooner or later, we should provide refs in as callbacks. Also, accessing instances using the imperative method
getWrappedInstance
goes against React best practices.For this from now on we are removing the option
withRef
and instead you can pass aninnerRef
prop to the decorated component that will pass down aref
to the decorated component. This makes the API way easier.Since it's a breaking change, it will be released as a major version.