Skip to content

Commit c7af1e6

Browse files
committed
[BC] Migrate to react-native-webview
1 parent e9df771 commit c7af1e6

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ resolve: {
1111
alias: {
1212
'react-native': 'react-native-web',
1313
...
14-
'WebView': 'react-native-web-webview',
14+
'react-native-webview': 'react-native-web-webview',
1515
}
1616
}
1717
```
@@ -32,16 +32,17 @@ const rule = {
3232

3333
## Usage
3434
```js
35-
import WebView from 'WebView'; // don't import from react-native
35+
import { WebView } from 'react-native-webview';
3636
```
3737

38-
See [RN's doc](https://facebook.github.io/react-native/docs/webview.html).
38+
See [RN's doc](https://github.com/react-native-community/react-native-webview).
3939

4040
Supported props are:
4141
- `source`
4242
- `onMessage`
4343
- `scrollEnabled`
4444
- `injectedJavaScript`
45+
- `style`
4546

4647
Additional, web-specific props are:
4748
- `newWindow`: (*boolean*|*{ name: string, features: string}*)

docs/.storybook/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = (storybookBaseConfig, configType) => {
3030

3131
storybookBaseConfig.resolve.alias = {
3232
'react-native': 'react-native-web',
33-
WebView: path.join(__dirname, '../../src/'),
33+
'react-native-webview': path.join(__dirname, '../../src/'),
3434
};
3535

3636
return storybookBaseConfig;

docs/stories/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import WebView from 'WebView';
2+
import { WebView } from 'react-native-webview';
33

44
const html = '<html><body><h1>Hello world!</h1></body></html>';
55

docs/stories/method.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import WebView from 'WebView';
2+
import { WebView } from 'react-native-webview';
33
import { text } from '@storybook/addon-knobs';
44

55
export const basic = () => (

docs/stories/uri.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import WebView from 'WebView';
2+
import { WebView } from 'react-native-webview';
33
import { action } from '@storybook/addon-actions';
44
import { text } from '@storybook/addon-knobs';
55

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Qs from 'qs';
22
import React, { Component } from 'react';
33
import { StyleSheet, View, ActivityIndicator, createElement } from 'react-native';
44

5-
export default class extends Component {
5+
export class WebView extends Component {
66
static defaultProps = {
77
scrollEnabled: true,
88
};

0 commit comments

Comments
 (0)