@portal-hq/webview v4.0.3
Portal React Native WebView
The @portal-hq/webview
package exports a single WebView
component for loading dApps within your app with built-in Portal Provider injection.
Dependency linking
Because this package uses the react-native-webview
package (which contain native modules) there is some additional linking required to make it work with your React Native project.
Explicitly install the react-native-webview
package in your project.
yarn add react-native-webview
# OR #
npm install --save react-native-webview
Using the WebView Component
To use the WebView component, import it from the @portal-hq/webview
package and use it as you would the react-native-webview
package and render the component within your app.
import WebView from '@portal-hq/webview'
const App = () => {
return <WebView url={'https://app.uniswap.com/'} />
}
Optional Props
The WebView
component two optional props that can be used to customize the behavior of the WebView.
onNavigationStateChange
This allows you to provide a callback for when the navigation state changes. This allows you to manage loading states and other navigation events.
onSigningRequested
This allows you to provide a callback for when signing is requested. For the most part, this prop is not needed if you have already set up the PortalProvider
in your app.
10 months ago
11 months ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago