Skip to content

Instantly share code, notes, and snippets.

@aaronblondeau
Last active August 26, 2017 19:34
Show Gist options
  • Save aaronblondeau/aad0837ca810e25fb2a4522e04a53d8d to your computer and use it in GitHub Desktop.
Save aaronblondeau/aad0837ca810e25fb2a4522e04a53d8d to your computer and use it in GitHub Desktop.
Detail screen refactored to take thing object param and display basic info
import React, { Component } from 'react';
import {
StyleSheet,
} from 'react-native';
import { Container, Content, Button, Text, Icon } from 'native-base';
import {observer} from 'mobx-react';
import applicationState from '../ApplicationState'
import { NavigationActions } from 'react-navigation'
@observer
export default class DetailScreen extends Component {
static navigationOptions = ({ navigation }) => ({
title: navigation.state.params.thing.name,
});
render() {
const { dispatch } = this.props.navigation;
const { params } = this.props.navigation.state;
const backAction = NavigationActions.back({});
return (
<Container>
<Content>
<Text>{params.thing.description}</Text>
</Content>
</Container>
);
}
}
const styles = StyleSheet.create({
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment