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

Per #320, this adds an example for onShouldStartLoadWithRequest.
This commit is contained in:
Jamon Holmgren
2019-03-01 01:27:17 +01:00
committed by Thibault Malbranche
parent 4ad7036733
commit d28071cf52
+25
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`