chore(docs): Adds example for onShouldStartLoadWithRequest (#321)
Per #320, this adds an example for onShouldStartLoadWithRequest.
This commit is contained in:
parent
4ad7036733
commit
d28071cf52
|
@ -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`
|
||||
|
|
Loading…
Reference in New Issue