react-native error when going over tutorial at react native site -
i complete beginner, please provide explanation.
i following react-native tutorial @ https://facebook.github.io/react-native/releases/0.19/docs/tutorial.html
i run command init project, call movies instead of awesomeproject tutorial explains.
then copied complete code bottom of tutorial index.ios.js, save project , refreshed emulator , error
error: bundling failed: "transformerror: /users/dinob/reactnativework/movies/index.ios.js: unexpected token ) (while processing preset: \"/users/dinob/reactnativework/movies/node_modules/ babel-preset-react-native/index.js\")"
react-native-cli: 2.0.1 react-native: 0.47.1 react: 16.0.0-beta.2
what can see is, tutorial you're following rn 0.19
while newest stable version 0.47. examples codes inside use older es5 syntax , not newer class based syntax came in es6/es2015
firstly, please make sure you're following newest tutorial version , code. can here. https://facebook.github.io/react-native/docs/tutorial.html error can see there related babel transform , possibly attributed newer version of react native plus newer version of react running older code. should start newer tutorial , take there. also, use of react-native-cli
depreciated. should use create-react-native-app
start new project. it's in docs.
hope helps!
Comments
Post a Comment