react_1.styled is not a function
See original GitHub issueI took the evening to migrate my library from using styled-components to stitches. When I start Storybook, the styles get applied perfectly. However, when I build the library and install it somewhere else, I get: react_1.styled is not a function
. (see here).
This is the branch of my library where I am using stitches now: https://github.com/table-library/react-table-library/tree/feat/stitches Compared to using styled-components (or emotion), I thought I wouldn’t have to change anything in the tsconfig.json or babel.config.js to make it work. Or am I wrong here? I am using rollup to bundle everything.
Thanks for your help! Really looking forward getting this to work!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:14
Top Results From Across the Web
Styled.div is not a function after rollup built of format "es" #3700
Debugging within the lib's built has shown that styled.div is indeed undefined since styled holds default and just then has div ( styled.default ......
Read more >reactjs - type error extend is not a function in styled components
The CustomElement.extend function was removed in styled components version 4, so you must be using version 4 or above, where it no longer ......
Read more >API Reference - styled-components
A utility to help identify styled components. Arguments, Description. 1. Function, Any function expected to possibly be a styled component or React component ......
Read more >Styled Components - Emotion
styled is a way to create React components that have styles attached to them. ... literal for string styles or a regular function...
Read more >DOM Elements - React
function createMarkup() { return {__html: 'First · Second'}; } function ... Not all style properties are converted to pixel strings though.
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
I get the same with brand new minimal apps. This is a brand new create-react-app application with only storybook and Stitches installed. It exports one button: https://github.com/jnoer/storybook/tree/no-stitches-config
Target application. It’s a brand new create-react-app that imports the above button component: https://github.com/jnoer/react-app/tree/no_stitches_config
I tested with Emotion instead of Stitches and that does work.
@hadihallak Can we reopen this?
I had opened this issue which is the same, but the error is a little different since it uses stitches.config.js. https://github.com/stitchesjs/stitches/issues/1061
React 18 is not supported. See https://github.com/stitchesjs/stitches/issues/1059
We have switched over to Emotion.