const React = require('react'); const { View, Text } = require('react-native'); const testIDs = require('../testIDs'); const { TitleContext, Context } = require('../context'); class ContextScreen extends React.Component { static contextType = Context; static options() { return { topBar: { title: { text: 'My Screen' }, background: { color: 'red' } } }; } render() { return ( Default value: {this.context} Provider value: {title => ( {title} )} ); } } module.exports = ContextScreen; const styles = { root: { flexGrow: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#f5fcff' }, h1: { fontSize: 24, textAlign: 'center' }, h2: { fontSize: 12, textAlign: 'center', }, };