Reputation: 375
I'm writing a react-native component and I use events but my native module doesn't build on older version of react when sending events were by bridge.eventDispatcher..
So is there a way to check the version to switch between react and react-native modules implementations? Thanks.
Upvotes: 6
Views: 19262
Reputation: 9701
If you type react-native --version
inside a project, it will tell you the installed version.
Tested with react-native-cli
version 2.0.1, can be installed with:
npm install -g react-native-cli
Note that if you're running multiple node versions you may have to install the CLI for each node version. Also, you may first have to run npm install
on the project.
Upvotes: 6
Reputation: 1690
check remote version of react-native
npm info react-native version
check version of react-native
npm list --depth=0
remove older version of react-native
npm --save remove react react-native
Install x version of react-native
npm --save [email protected] //maybe 0.30.0
Note that you can use these commands for all modules in node_modules folder. Also you can check your react-native version in package.json file which is in your project.
'Before doing any changes be sure that problem is about incompability between react and react-native version' so had better share complete error log.
Upvotes: 15