Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check react-native version of project?

Tags:

react-native

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.

like image 552
Yousef Hamza Avatar asked Oct 16 '16 14:10

Yousef Hamza


People also ask

How do I find my react-native project version?

If you type react-native --version inside a project, it will tell you the installed version (tested with react-native-cli v. 2.0. 1).

What is current version of react-native?

We are excited to release a new version of React Native, 0.70.

How do you tell if a project is react or react-native?

So when you write your components, you can check if React. View exists. If it does, you're using React Native. Otherwise, you're using the web version.


2 Answers

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.

like image 107
Burak Karasoy Avatar answered Jan 04 '23 04:01

Burak Karasoy


If you type react-native --version inside a project, it will tell you the installed version (tested with react-native-cli v. 2.0.1).

like image 30
martinarroyo Avatar answered Jan 04 '23 04:01

martinarroyo