I need to open the website inside my react-native app. Needs to work for both iOS and Android
3
-
Do you need it to be opened inside on of your screens or it could be opened inside external webbrowser?Kirill Kunst– Kirill Kunst2019-10-24 05:20:27 +00:00Commented Oct 24, 2019 at 5:20
-
1you can use react-native -webviewLenoarod– Lenoarod2019-10-24 05:32:43 +00:00Commented Oct 24, 2019 at 5:32
-
@KirillKunst I need to open inside in my screens I need to design the header and footer section of that screensejn– sejn2019-10-24 05:50:25 +00:00Commented Oct 24, 2019 at 5:50
Add a comment
|
1 Answer
You can use WebView
component: https://facebook.github.io/react-native/docs/webview.html.
Something like this:
import React, { Component } from 'react';
import { WebView } from 'react-native';
class MyWebViewComponent extends Component {
render() {
return (
<WebView
source={{uri: 'https://google.com'}}
style={{marginTop: 10}}
/>
);
}
}