-
Notifications
You must be signed in to change notification settings - Fork 93
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
React 16.3+ forwardRef component #48
Comments
The annotations are a little confusing here, but I think I understand the use case. It should be as easy as adding |
This is okay, but not perfect. Because it will not hoist IMHO adding component type conditions to detect non-react specific statics would be better. Thanks for replying. 😀 |
Agreed on the component type specific logic. Here is what I'm thinking:
I am working through some issues in |
@mridgway any updates here? |
I will work on getting this in soon. It looks like React maintainers will not be adding a |
I opened #55 and published |
v3.0.0 is now published as latest. |
React 16.3+ forwardRef() will return a new component (type is
object
) that contains arender
function and a$$typeof
Symbol, and these should not be copied, otherwise may cause some bugExample to reproduce
Result
this.props
{bar: "bar"}
Expect
this.props
{foo: "foo", bar: "bar"}
If I uncomment
hoistStatics(HoistedComponent, WrappedComponent /* , { render: true } */)
, it will work as expected.Env
The text was updated successfully, but these errors were encountered: