MDLAB 기록/차량부품거래애플리케이션
[React Native -13] Web View
지유미
2022. 11. 24. 19:15
728x90
반응형
Web View: 기존에 있던 웹페이지를 앱으로 옮기는 것
이전에는 자체적으로 지원을 해주었지만 현재는 지원하지 않는 상태이다
따라서 공식 홈페이지에서 추천하는 react-native-webview 라이브러리를 설치하겠다
https://github.com/react-native-webview/react-native-webview
GitHub - react-native-webview/react-native-webview: React Native Cross-Platform WebView
React Native Cross-Platform WebView. Contribute to react-native-webview/react-native-webview development by creating an account on GitHub.
github.com
✅ WebView 라이브러리 설치
npm install react-native-webview
import React, { Component } from 'react';
import { WebView } from 'react-native-webview';
class SearchWebView extends Component {
constructor(props) {
super(props);
}
render() {
return (
<WebView source={{ uri: 'http://www.google.com' }} />
)
}
}
export default SearchWebView;
728x90
반응형