Skip to content
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 forwarded ref component #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mathieudutour
Copy link

Trying to suspend in a react component created with React.forwardRef would throw the following error:

A React component suspended while rendering, but no fallback UI was specified. Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.

With this patch, shimElement supports forwardedRef component and the error disappears.

@overlookmotel
Copy link
Owner

Thanks very much for this. I'll look at it as soon as I get a minute.

In meantime, could you please:

  1. Add a test
  2. Fix lint errors (CI seems to be disabled right now due to changes at Travis, but I can see from the code style that lint would fail - run npm run lint to check linting)

Do you think same problem would occur with other wrapped components e.g. React.memo() etc?

Also, what version of React are you using?

@mathieudutour
Copy link
Author

Add a test

I wasn't sure where to add it as I didn't find any related to that part of the code. Could you point me to it?

Do you think same problem would occur with other wrapped components e.g. React.memo() etc?

That's a good question, I'll have look

what version of React are you using?

react@experimental-4ead6b530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants