Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
feat(nav): Upgrades to React Navigation 3.0 and React Native 0.57.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lvlrSajjad authored and morgandonze committed Dec 2, 2018
1 parent bc2dbcb commit 9fea583
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions boilerplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,30 @@ async function install(context) {
await system.spawn('react-native link', { stdio: 'ignore' })
spinner.stop()

await ignite.addModule('react-native-gesture-handler', { version: '1.0.9', link: true })

ignite.patchInFile(`${process.cwd()}/android/app/src/main/java/com/${name.toLowerCase()}/MainActivity.java`, {
after: 'import com.facebook.react.ReactActivity;',
insert: `
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;`
})

ignite.patchInFile(`${process.cwd()}/android/app/src/main/java/com/${name.toLowerCase()}/MainActivity.java`, {
after: `public class MainActivity extends ReactActivity {`,
insert: '\n @Override\n' +
' protected ReactActivityDelegate createReactActivityDelegate() {\n' +
' return new ReactActivityDelegate(this, getMainComponentName()) {\n' +
' @Override\n' +
' protected ReactRootView createRootView() {\n' +
' return new RNGestureHandlerEnabledRootView(MainActivity.this);\n' +
' }\n' +
' };\n' +
' }'
})


// patch splash screen
async function patchSplashScreen() {
spinner.text = `▸ setting up splash screen`
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"i18n-js": "^3.0.11",
"react-native-keychain": "3.0.0",
"react-native-splash-screen": "3.1.1",
"react-navigation": "2.16.0",
"react-navigation": "3.0.0",
"reactotron-mst": "^2.1.0",
"reactotron-react-native": "^2.1.0",
"validate.js": "0.12.0"
Expand Down
2 changes: 1 addition & 1 deletion lib/react-native-version.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { pathOr, is } = require('ramda')

// the default React Native version for this boilerplate
const REACT_NATIVE_VERSION = '0.57.5'
const REACT_NATIVE_VERSION = '0.57.7'

// where the version lives under gluegun
const pathToVersion = ['parameters', 'options', 'react-native-version']
Expand Down

0 comments on commit 9fea583

Please sign in to comment.