mobx-react-lite observer(Component, {forwardRef: true})
doesn't seem to work
#3267
Labels
observer(Component, {forwardRef: true})
doesn't seem to work
#3267
Intended outcome:
Expected to be able to render a component that is exported as
observer(Component, {forwardRef: true})
Actual outcome:
Get error:
How to reproduce the issue:
Make a component that uses
React.forwardRef
, then export that component asexport default observer(Component, {forwardRef: true});
.There is an issue that seems to be related, and I went by this comment in that thread to try the
{forwardRef: true}
option:#2527 (comment)
However, that doesn't seem to work b/c the ref-forwarding component is an object and not a function:
Am I using this incorrectly, or should I just use
mobx-react
? I had been usingmobx-react
but we only use functional components so figured I'd switch tomobx-react-lite
to get the smaller bundle.Versions
Thanks in advance 😄
The text was updated successfully, but these errors were encountered: