Skip to content

Question about styled-components #571

Answered by ben-rogerson
flavio-ever asked this question in Q&A
Discussion options

You must be logged in to vote

You can import styled but may run into some issues - the safe way is to import styled through twin.

Here's how I'd change your example:

import tw, { styled } from 'twin.macro'

export const App = tw.div`flex justify-center items-center h-screen`

The styled import works great in the following typescript twin examples, could you let me know where you saw the broken implementation of styled?

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@flavio-ever
Comment options

@flavio-ever
Comment options

@flavio-ever
Comment options

@ben-rogerson
Comment options

@flavio-ever
Comment options

Answer selected by flavio-ever
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants