Created
July 6, 2017 16:53
-
-
Save tomasc/6e0efe94c388f293b60da1d191a1e89e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { AppRegistry, FlatList } from 'react-native'; | |
import { StyleSheet, Text, View, ScrollView } from 'react-native'; | |
import WKWebView from 'react-native-wkwebview-reborn'; | |
class WKWebViewTest extends Component { | |
renderItem = ({item, index}) => ( | |
<WKWebView | |
style={{ height: 500 }} | |
source={{ uri: item.uri }} | |
/> | |
); | |
getItemKey = (item, index) => index; | |
render() { | |
return ( | |
<FlatList | |
initialNumToRender={2} | |
data={[ | |
{ uri: 'https://www.google.com' }, | |
{ uri: 'https://www.google.com' }, | |
{ uri: 'https://www.google.com' }, | |
{ uri: 'https://www.google.com' }, | |
{ uri: 'https://www.google.com' }, | |
{ uri: 'https://www.google.com' }, | |
{ uri: 'https://www.google.com' }, | |
{ uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
// { uri: 'https://www.google.com' }, | |
]} | |
keyExtractor={this.getItemKey} | |
renderItem={this.renderItem} | |
style={{ backgroundColor: '#f00', marginTop: 20 }} | |
/> | |
); | |
} | |
} | |
AppRegistry.registerComponent('WKWebViewTest', () => WKWebViewTest); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment