react-native-swipeable icon indicating copy to clipboard operation
react-native-swipeable copied to clipboard

Update example

Open ixje opened this issue 7 years ago • 0 comments

I was trying to build the example following these steps from the readme

npm run build
cd example
npm install
react-native run-ios # or run-android

and ran into a couple of things which I think could be improved/clarified.

The npm run build command will fail with the following error if babel isn't installed globally.

building lib/index.js make: ./node_modules/.bin/babel: No such file or directory make: *** [lib/index.js] Error 1

Installing babel globally is actually not recommended by babel itself. To quote them;

Note: Since it's generally a bad idea to run Babel globally you may want to uninstall the global copy by running npm uninstall --global babel-cli.

I'd suggest adding npm install prior to the npm run build in the readme for some of us new comers working with npm that don't straight away understand what the error is about. This will install babel locally.

  1. react-native version The react-native version in package.json is fixed to "react-native": "0.40.0",. Besides it being quite old. The main package.json has it set to "react-native": ">=0.44.0". I think at least sync'ing the two files on dependencies would be nice.

Even after fixing these minor things I couldn't get it to work. I had failing scripts like react-native-xcode.sh no longer found in react-native/Packager/ but react-native/scripts/ and import paths not working. I ended up creating a new project as follows (starting from the root folder): react-native init SwipeableExample cd SwipeableExample npm install react-native-swipeable --save cp ../example/index.*.js ../example/swipeable-example.js . react-native run-ios

This way the example works.

Versions:
npm 5.3.0 react-native-swipeable 0.6.0 react-native 0.46.4

ixje avatar Jul 24 '17 08:07 ixje