Replies: 2 comments 2 replies
-
Hey there, great to hear you've been enjoying twin. I'm keen on improving the types or looking over a pr as I'm most busy right now.
Would you be able to share this example - it sounds interesting. |
Beta Was this translation helpful? Give feedback.
0 replies
-
That said, it still would be helpful to make the tw prop optional, as we would like to remove it for consistency reasons as well. We prefer not to modify the global JSX types, to simplify developer experience with using types. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey! Absolutely love using twin.macro.
One issue we are hitting is that if we ever import
twin.macro
the global declaration of thetw
prop occurs on any component. This means that any component regardless of if it supports the css prop, or the className prop receives this type.As an example, in https://github.com/ben-rogerson/twin.examples/tree/master/component-library-emotion when using any of the components you defined, the
tw
prop is available, even though it just gets swallowed. This creates a bad dev experience for devs when they see the prop available, and it doesn't actually affect anything. Either: moving to the approach that emotion uses to only add it ifclassName
is available, or, moving the global declaration out of the default export, so we can importtw
andGlobalStyles
separately.Beta Was this translation helpful? Give feedback.
All reactions