Skip to content

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