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
4
Answers
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 reinstallednpm install [email protected]
and then I read the documentation of Styled Componentand installed
styled-components
usingyarn add styled-components
and successfully sorted out my problem.Try to install it with this command
This fixed it for me (using expo managed react-native app)
https://github.com/styled-components/styled-components/issues/3788#issuecomment-1335191911
I had same problem when taking Udemy course about React Native. This course provides git with complete code, so what I did was:
npm install