Lesson
Open a Webpage in React Native with Linking and WebView
There are two ways to open urls in React Native. One is to open, and switch to the device's web browser, and the other is to embed the web page within your application.
- Duration
- 2 min
- Access
- Free
- Transcript
- Available
There are two ways to open urls in React Native. One is to open, and switch to the device's web browser, and the other is to embed the web page within your application.
To open the mobile device's web browser, we'll import Linking from react native, and use the openURL function, which will open any url that starts with http or https in that web browser.
If you want to stay within your current application however, you can import WebView from react native, and use that as a component in your application. Pass in a uri param to display that web page in the embedded web view.