Description
React version: 18.3.0-next-3ba7add60-20221201
Steps To Reproduce
I haven't been able to create a minimal example yet, if needed I will spend more time on it. However, it only seems to occur when Suspending components rerender in a specific order.
Description
The Component is not a function
error is thrown when using Suspense and forwardRef together in a specific way.
It seems like react-reconciler doesn't properly handle forwardRefs in either renderWithHooksAgain
, replaySuspendedComponentWithHooks
, replayFunctionComponent
or replaySuspendedUnitOfWork
. The Component
variable is not a function in this case, but a { $$typeof: Symbol(react.forward_ref), render: (props, ref) => any }
. renderWithHooksAgain
tries to execute Component(props, secondArg)
, which throws this error.
I'm not too familiar with React internals, if you can tell me how to trigger this codepath I can make a minimal reproduction more easily.