How to use the newer versions of motion with third party components #2893
Unanswered
manuelpoelzl
asked this question in
Q&A
Replies: 1 comment 1 reply
-
forwardRef was always required to work - I wonder though if the types have changed? Card should be forwarding its ref but maybe it’s typed in an incompatible manner. How’s it if you use the new motion.custom()? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
In previous versions of the library it was possible to enable animations for custom and third party components.
I've previously used the following logic in combination with the PrimeReact framework:
However since a couple of version this results in the following error:
TS2345: Argument of type typeof Card is not assignable to parameter of type string | ForwardRefExoticComponent<unknown>
Apparently now a component with
forwardRef
is needed to make this work.I was wondering is there a way to use the components provided by e.g. PrimeReact without creating a wrapper component around it?
Beta Was this translation helpful? Give feedback.
All reactions