Skip to content

Commit 44176b7

Browse files
committed
doc: update docs
1 parent 5adc148 commit 44176b7

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![npm](https://img.shields.io/npm/dy/react-native-progress-webview.svg) ![npm](https://img.shields.io/npm/v/react-native-progress-webview.svg) [![star this repo](http://githubbadges.com/star.svg?user=wangdicoder&repo=react-native-progress-webview&style=flat)](https://github.com/wangdicoder/react-native-progress-webview) ![GitHub](https://img.shields.io/github/license/wangdicoder/react-native-progress-webview.svg)
44

5-
**React Native Progress WebView** is a wrapper of [React Native WebView](https://github.com/react-native-community/react-native-webview) to provide the loading status.
5+
**React Native Progress WebView** is a wrapper of [React Native WebView](https://github.com/react-native-community/react-native-webview) to provide a loading bar on the top of the browser.
66

77
<img src="https://raw.githubusercontent.com/wangdicoder/react-native-progress-webview/master/screenshot.gif" width="326" height="576" />
88

@@ -50,6 +50,34 @@ class App extends Component {
5050
| errorColor | string | #f30 | the error color of loading bar |
5151
| disappearDuration | number | 300 | the visible duration after the webview finishes the loading |
5252

53+
## Common issues
54+
55+
#### How can I use `ref` to get WebView methods?
56+
57+
It's same as using raw WebView. You can just pass a `ref` prop to get the instance.
58+
59+
```jsx
60+
class App extends Component {
61+
constructor(props){
62+
super(props);
63+
this.ref = React.createRef();
64+
}
65+
66+
componentDidMount() {
67+
console.log(this.ref.current);
68+
}
69+
70+
render() {
71+
return (
72+
<ProgressWebView
73+
ref={this.ref}
74+
source={{ uri: 'https://facebook.github.io/react-native/' }}
75+
/>
76+
);
77+
}
78+
}
79+
```
80+
5381
## License
5482

5583
MIT

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-progress-webview",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "React Native Progress WebView is a wrapper of React Native WebView to provide the loading status.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)