The EntryDetail
screen is just WebView: a component-abled rendering web content in a native view. You can think of a WebView as a lightweight web browser displaying the contents of a website for a provided URL:
import React from 'react'; import { Container, Content } from 'native-base'; import { WebView } from 'react-native'; export default class EntryDetail extends React.Component { render() { const entry = this.props.screenProps.store.selectedEntry; return <WebView source={{ uri: entry.link.href || entry.link }} />; } }
The render
method in this component is merely returning a new WebView
component loading the URL from the selected entry inside the store. As we did with the feed's data in the previous sections, we need to retrieve the selectedEntry
data from this.props.screenProps.store
. The URL can be stored in two different ways depending on the RSS version of the feed: in the link property or one level deeper in link.href
.