Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add styled-components to Codepen

Try to use styled-components in my pen https://codepen.io/mxshrv/pen/aMXvQd, but get error

Cannot use 'in' operator to search for 'default' in undefined

styled is not defined

How to add a library correctly for my pen?

like image 278
while1pass Avatar asked May 10 '26 13:05

while1pass


1 Answers

Looks like Styled Components v5 has added a new requirement. You now also need react-is to be able to use SC.

So in your pen, under external scripts, search for react-is and add it.

I would also recommend moving it up to be just after react and react-dom and before your styled-components script.

like image 71
Joe Seifi Avatar answered May 13 '26 02:05

Joe Seifi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!