You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added a button with emotion to the default App.tsx that comes with create-react-app
import*asReactfrom'react';importstyledfrom'react-emotion';import'./App.css';importlogofrom'./logo.svg';constButton=styled('button')` color: rebeccapurple;`;classAppextendsReact.Component{publicrender(){return(<divclassName="App"><headerclassName="App-header"><imgsrc={logo}className="App-logo"alt="logo"/><h1className="App-title">Welcome to React</h1></header><pclassName="App-intro">
To get started, edit <code>src/App.tsx</code> and save to reload.
</p><Button>
Test Button
</Button></div>);}}exportdefaultApp;
What happened:
autoLabel and sourceMap aren't working. I tried the same steps but using create-react-app without TypeScript and I see the super helpful auto-labeled classname css-1hha610-Button e1c0eqbh0 and the line number that the CSS is at in App.js is shown in Chrome devtools.
Reproduction:
Install the TypeScript version of create-react-app
Run the create-react-app eject script
Install emotion, react-emotion, and babel-plugin-emotion
Add config for babel that enables the sourceMap and autoLabel options
Create a simple emotion component in App.tsx
Run npm start
Go look for the class label and line numbers in your favorite browser
I'm thinking that making a repo for this issue is overkill and whoever looks at this would probably want to follow the steps themselves, but if I'm wrong and it would help let me know and I'll create one.
The text was updated successfully, but these errors were encountered:
emotion
version: 9.2.8react
version: 16.4.2react-emotion
version: 9.2.8babel-plugin-emotion
version 9.2.8What I did:
create-react-app emotion-test --scripts-version=react-scripts-ts
npm run eject
npm i -S emotion react-emotion babel-plugin-emotion
true
What happened:
autoLabel and sourceMap aren't working. I tried the same steps but using create-react-app without TypeScript and I see the super helpful auto-labeled classname
css-1hha610-Button e1c0eqbh0
and the line number that the CSS is at in App.js is shown in Chrome devtools.Reproduction:
npm start
I'm thinking that making a repo for this issue is overkill and whoever looks at this would probably want to follow the steps themselves, but if I'm wrong and it would help let me know and I'll create one.
The text was updated successfully, but these errors were encountered: