Skip to content

Commit f7c7bb0

Browse files
author
Alex Alexeev
committed
Add fix instruction in readme
1 parent 802b815 commit f7c7bb0

1 file changed

Lines changed: 62 additions & 4 deletions

File tree

README.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,64 @@
1-
# surveyjs-inside-react-native-webview
2-
An example React Native app project to show the necessary changes and working JS library dependencies necessary to nest a webview containing a SurveyJS survey INSIDE a React Native app. Turtles all the way down!
1+
# alex-bootcamp
32

4-
If you have the necessary React Native and npm development environments already installed, then clone this repo and type
3+
# Fixes for iOS https://github.com/abolger/surveyjs-inside-react-native-webview:
54

6-
'react-native run-ios' or 'react-native run-android' at the command line and be prepared to be amazed!
5+
## 0. Remove lock files
6+
7+
```bash
8+
rm yarn.lock package-lock.json
9+
```
10+
11+
then generate fresh one with `yarn` or `npm install`
12+
13+
## 1. Upgrade react-native
14+
15+
```bash
16+
react-native-git-upgrade
17+
```
18+
19+
as a result it will also bump `react` version, change some
20+
`ios/` and `android/` files, `.gitignore`, `.babelrc` and .`flowconfig`
21+
22+
IMPORTANT: make sure there are no errors in command output
23+
with a big probabilty there will be conflict(s) in `ios/SurveyJSInWebViewWithReactAndReactNative.xcodeproj/project.pbxproj`
24+
just accept incoming git changes there
25+
26+
PS if you run `react-native-git-upgrade` again it can throw an error about unavailable babel plugin
27+
to make the command pass you may need to remove `.babelrc` and return it back after
28+
29+
## 2. Update babel preset
30+
31+
```bash
32+
yarn remove babel-preset-react-native
33+
```
34+
35+
```bash
36+
yarn add metro-react-native-babel-preset -D
37+
```
38+
39+
even though `react-native-git-upgrade` supposed to make the preset change,
40+
double-check that `.babelrc` is like :
41+
42+
```js
43+
{
44+
"presets": ["module:metro-react-native-babel-preset"]
45+
}
46+
```
47+
48+
## 3. Add `native-base`
49+
50+
```bash
51+
yarn add native-base
52+
```
53+
54+
## 4. Update React-Native-Webview-Bridge.xcodeproj
55+
56+
`yarn add react-native-webview-bridge` (currently 0.40.1)
57+
58+
Optional: You may need to also follow README for iOS here https://github.com/alinz/react-native-webview-bridge
59+
(to make sure `Library/React-Native-Webview-Bridge.xcodeproj` references the project from the fresh npm package)
60+
61+
## Optional: 5. Update other packages
62+
63+
This step do not require any code fixes, just bump them :)
64+
Only leave both `react` and `react-test-renderer` at version 16.6.3

0 commit comments

Comments
 (0)