Replies: 2 comments 1 reply
-
Adding onto this, I've just been looking at other files in the jsx directory (e.g. box, container, center, circle...) and it seems they have this same setup as described above. I guess these would need to be changed as well then if my findings are correct. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Interesting. How about doing I'm not inclined to change the typings since |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Can the typings of the Flex component be optimized so that it correctly reflects the implementation?
Problem Statement/Justification
I was trying to setup a custom component with
motion.create
(from Framer Motion), because I don't want to wrap each of my components inside of amotion.div
.Looking at the typing information of
motion.create
we see that it requires aForwardRefExoticComponent
:However, if we look at the types of the Flex component, we see that it's typed as a
FunctionComponent
.And if we look at the
flex.mjs
module or inspect the Flex component in the browser with the devtools, we can see that the component in question is a forwarded ref:So I guess the typings here aren't setup correctly.
Proposed Solution or API
I guess the only thing that would need to be done is changing this:
into this:
in order for the error to go away.
Alternatives
No response
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions