chore(docs): Adds example for onShouldStartLoadWithRequest (#321)

Per #320, this adds an example for onShouldStartLoadWithRequest.
This commit is contained in:
Jamon Holmgren 2019-02-28 16:27:17 -08:00 committed by Thibault Malbranche
parent 4ad7036733
commit d28071cf52
1 changed files with 25 additions and 0 deletions

View File

@ -268,6 +268,31 @@ On Android, is not called on the first load.
| -------- | -------- |
| function | No |
Example:
```jsx
<WebView
source={{ uri: "https://facebook.github.io/react-native" }}
onShouldStartLoadWithRequest={(request) => {
// Only allow navigating within this website
return request.url.startsWith("https://facebook.github.io/react-native")
}}
/>
```
The `request` object includes these properties:
```
title
url
loading
target
canGoBack
canGoForward
lockIdentifier
navigationType
```
---
### `startInLoadingState`