Skip to content

Commit 69cd6ea

Browse files
committed
Update descriptions
1 parent 701038d commit 69cd6ea

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![npm](https://img.shields.io/npm/v/react-native-react-bridge) ![check](https://github.com/inokawa/react-native-react-bridge/workflows/check/badge.svg)
44

5-
An easy way to integrate your [React](https://github.com/facebook/react) app into [React Native](https://github.com/facebook/react-native) app with WebView.
5+
An easy way to integrate your [React](https://github.com/facebook/react) (or [Preact](https://github.com/preactjs/preact)) app into [React Native](https://github.com/facebook/react-native) app with WebView.
66

77
## Why?
88

@@ -21,7 +21,7 @@ The communication between React app and React Native app will be also simplified
2121

2222
## Features
2323

24-
- Create React app bundle for WebView automatically in build process of React Native
24+
- Create React (or Preact) app bundle for WebView automatically in build process of React Native
2525
- `.js`, `.ts`, `.jsx`, `.tsx` and `.mjs` will be packed into one source.
2626
- NOTE: Only the edits in the entry file of web will invoke rebuild because of the limitation of [metro](https://github.com/facebook/metro)'s build process.
2727
- Handle communication between React Native and WebView with React hook style
@@ -41,16 +41,20 @@ If you have some feature requests or improvements, please create a [issue](https
4141
## Install
4242

4343
```sh
44-
npm install react-native-react-bridge
44+
npm install react-native-react-bridge react-native-webview
4545

46-
# These are used to render React app in WebView
47-
npm install react-dom react-native-webview
46+
# Necessary only if you render React app in WebView
47+
npm install react-dom
48+
49+
# Necessary only if you render Preact app in WebView
50+
npm install preact
4851
```
4952

5053
### Requirements
5154

52-
- react 16.8+
53-
- react-native 0.60+
55+
- react >= 16.8
56+
- react-native >= 0.60
57+
- (preact >= 10.0)
5458

5559
## Usage
5660

@@ -68,7 +72,10 @@ module.exports = {
6872
};
6973
```
7074

71-
2. Make entry file for React app.
75+
2. Make entry file for web app.
76+
77+
- If you use React in web, import modules from `react-native-react-bridge/lib/web` and `react`.
78+
- If you use Preact in web, import modules from `react-native-react-bridge/lib/web/preact` and `preact`.
7279

7380
```jsx
7481
// WebApp.js

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-native-react-bridge",
33
"version": "0.4.3",
4-
"description": "An easy way to integrate your React app into React Native app with WebView.",
4+
"description": "An easy way to integrate your React (or Preact) app into React Native app with WebView.",
55
"main": "lib/index.js",
66
"module": "lib/index.mjs",
77
"types": "lib/index.d.ts",
@@ -47,9 +47,10 @@
4747
"url": "git+https://github.com/inokawa/react-native-react-bridge.git"
4848
},
4949
"keywords": [
50-
"react",
5150
"react-native",
51+
"react",
5252
"react-dom",
53+
"preact",
5354
"metro",
5455
"webview",
5556
"html",

0 commit comments

Comments
 (0)