-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Support 'memo(forwardRef(...' #592
Conversation
Thanks for contributing. Could you show me an example of what is not working? When I use the example from the test and enter it into the playground I already get the same result as in the test.
|
What I see in playground, and in our case also is that this does not work in playground: import React, {memo,forwardRef} from 'react';
export default memo(forwardRef(({ foo = 'bar' }, ref) => <div ref={ref}>{foo}</div>)); This does work: import React, {memo,forwardRef} from 'react';
export default React.memo(forwardRef(({ foo = 'bar' }, ref) => <div ref={ref}>{foo}</div>)); So does this: import React, {memo,forwardRef} from 'react';
export default memo(({ foo = 'bar' }, ref) => <div ref={ref}>{foo}</div>); I've update the test code in the PR, it still pass, but I'm not sure if this is the proper way of fixing the issue or there is a simpler fix. |
86211ec
to
0f3ba92
Compare
Thanks again. I looked into this more and discovered that the underlying issue is that |
Co-authored-by: Daniel Tschinder <231804+danez@users.noreply.github.com>
Co-authored-by: Daniel Tschinder <231804+danez@users.noreply.github.com>
While
forwardRef(...)
is already supportedmemo(forwardRef(...))
doesn't.