Why are so many things broken at once?
See original GitHub issueIn a create-react-app
project using TypeScript
and styled-components
After update to 1.1.0
import tw, {TwStyle} from 'twin.macro';
=> console
✕ Twin doesn't recognize { TwStyle }
Try one of these imports:
import { tw, styled, css } from twin.macro
2.a.
import 'twin.macro';
...
<button
type="button"
tw="hover:bg-teal-500 hover:text-white flex items-center block px-6 py-4 mr-2 font-bold text-teal-500 border border-teal-500 rounded-sm">
Previous page
</button>
OR
2.b.
import tw from 'twin.macro';
import {css} from 'styled-components';
<button
type="button"
css={[
tw`hover:text-white hover:bg-teal-500 flex items-center block px-6 py-4 mr-2 font-bold text-teal-500 border border-teal-500 rounded-sm`,
]}
>
Previous page
</button>
3
import 'twin.macro';
<button type="button" tw="hover:text-white">
Previous page
</button>
with autoCssProp: true,
in babel-plugin-macros.config.js
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
What It Means When Everything is Breaking - Walkabout Saga
Why it's a good sign when things start to break. Okay, not all the time, but sometimes. Here's what I mean.
Read more >Why do I break everything I touch? - Quora
The item has been placed in several different places before. Your memory just plucked the wrong place out of your head - the...
Read more >Why broken bones are a big deal in adulthood
As we age, broken bones can take much longer to heal and can point to more serious health concerns like Osteoporosis or other...
Read more >After a Broken Bone, the Risk of a Second Fracture
These second fractures can result in life-limiting disability and a permanent loss of independence. One in five patients dies within a year of ......
Read more >7 Things To Remember When You Feel Broken Inside - Lifehack
If "I am broken" is what you think to yourself, you can't miss this article. These 7 things will help you to hold...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@abhijithvijayan Thanks for the raising these issues. We’ve just added a fix in 1.1.1 to allow
TwStyle
to be imported@rbutera indeed.
@ben-rogerson I use strict-typing and some other rules that won’t allow building unless I typesafe every return function.
I used thr
TwStyle
as the styled block return type.It was fine in 1.0.0 btw.