Closed Nimelrian closed 7 years ago
Forgot to change tests, working on it...
Thanks @Nimelrian. This seems like a good idea indeed. Isn't there some documentation to edit there? Can't remember if the previous method was even documented.
A quick grep over the repository yielded no further results for getDecoratedComponentInstance
, so I guess there is no current documentation.
I'll add a section to the higher-prder docs regarding the new prop.
Thanks @Nimelrian. Do you want me to wait for it to merge the PR, or should I merge right away and release because you need this fast?
If you can wait 20 minutes with the merge I'll add the doc section beforehand :)
No problem. Take the time you need. I am not in a hurry.
Thanks @Nimelrian. Merging and releasing.
Released v3.0.0
.
Thanks for the quick merge, no more warnings in my console 👍
Previously, refs on the wrapped component's instances were created for each branched component. The refs could then be accessed using the
ComposedComponent
'sgetDecoratedComponentInstance
method. However, this implementation also assigned refs to Stateless Functional Components (SFCs), which is not supported by React and leads to console warnings by React from version 16 and upwards.The previous behavior has been replaced, removing the
getDecoratedComponentInstance
method from theComposedComponent
class, making this a breaking change.The new implementation takes a new prop
decoratedComponentRef
and assigns this to theref
of the wrapped component.