Use css prop on custom React components -- TypeScript issue #94
Unanswered
therealgilles
asked this question in
Q&A
Replies: 1 comment
-
I guess I am asking what the best way is to add the css prop to a custom component. Should I add the className prop or the css prop directly? And do I need the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using the css prop on custom React components. TypeScript complains that the component does not have a css prop type. But it works if I add a className prop to the component. I saw this code in
@emotion/react/types/jsx-namespace.d.ts
:Is there a way to use the css prop on a component without having to define a className prop?
For context, I am using twin.macro with Gatsby + emotion + jsx Runtime. I have the following in types/twin.d.ts:
Beta Was this translation helpful? Give feedback.
All reactions