i am new to developing react-native application in which i need to link html file.it gives blank output on my android emulator, even not any error. I just want to know how to link html file with react native. Basic code samples are given below..
i have gone through the this below link but it is not working in my scenario.. (React Native) Load local HTML file into WebView
App.js
import React, { Component } from 'react';
import {
View,
WebView
} from 'react-native';
const DataHTML = require('./data.html');
export default class App extends Component<Props> {
render() {
return (
<View>
<WebView
source={DataHTML}
style={{flex: 1}}
/>
</View>
);
}
}
data.html
<html>
<head></head>
<body>
<h1>Hello</h1>
</body>
</html>