Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed May 5, 2021
1 parent be53ca4 commit e5cf128
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,20 @@ module.exports = {
babelTransformerPath: require.resolve('react-native-react-bridge/lib/plugin'),
...
},
rnrb: {
// Set `true` if you use Preact in web side.
// This will alias imports from `react` and `react-dom` to `preact/compat` automatically.
preact: true
},
...
};
```

2. Make entry file for web app.

- If you use React in web, import modules from `react-native-react-bridge/lib/web` and `react`.
- If you use Preact in web, import modules from `react-native-react-bridge/lib/web/preact` and `preact`.
- If you use React in web, import modules from `react` and `react-native-react-bridge/lib/web`.
- If you use Preact in web, import modules from `preact` and `react-native-react-bridge/lib/web/preact`.
- If you use Preact in web but with React aliases, import modules from `react` and `react-native-react-bridge/lib/web`.

```jsx
// WebApp.js
Expand Down

0 comments on commit e5cf128

Please sign in to comment.