Home > Net >  React18 is not supporting styled-component
React18 is not supporting styled-component

Time:12-12

Can anyone help me out to solve this problem. As I am learning React Native, I was going through styled components but was facing an error related to styled components not compatible with react18 version. and same works in react@16 and below

I was trying to install styled-components for styling components in react-native. And i was receiving error saying that react18 is not compatible. I just want styled components to work

CodePudding user response:

Try to install it with this command

npm install styled-components --force

CodePudding user response:

I sorted the solution as styled-component was not working for react 18.0.2.

So I decided to uninstall react 18.0.2 by using npm uninstall [email protected] and then I reinstalled npm install [email protected] and then I read the documentation of Styled Component

and installed styled-components using yarn add styled-components and successfully sorted out my problem.

  • Related