Skip to content

Instantly share code, notes, and snippets.

@geirman
Created October 20, 2015 01:23
Show Gist options
  • Save geirman/45f4910d7f2e5864f833 to your computer and use it in GitHub Desktop.
Save geirman/45f4910d7f2e5864f833 to your computer and use it in GitHub Desktop.
Problem with React Native Navigator
// TIDRT
class TrackedItemDetailRowTouchable extends React.Component{
constructor(props){
super(props);
}
render(){
let buttons = this.props.uids.map(uniqueId =>
<UIDButton
key={uniqueId}
uniqueId={uniqueId}
aircraft_object = {this.props.aircraft_object}
navigator={this.props.navigator}
/>
);
return(
<View style={styles.itemContainer}>
<Text style={styles.label}>
{this.props.label}:&nbsp;
</Text>
{buttons}
</View>
)
}
}
class TrackedItemDetail extends React.Component{
constructor(props){
super(props);
}
render(){
return(
<View style={styles.container}>
<TIDRT
label='Superseded By'
uids={[this.props.ti.superseded_by]}
aircraft_object={this.props.aircraft_object}
navigator={this.props.navigator}
/>
</View>
)
}
}
class UIDButton extends React.Component{
constructor(props){
super(props);
}
_handlePress( uid ){
this.props.navigator.push({
title: uid,
component: TrackedItemDetail,
passProps: {
uid: uid,
ti: this.props.aircraft_object.tracked_item.by_unique_identifier[uid],
aircraft_object: this.props.aircraft_object,
}
})
}
render(){
return(
<TouchableHighlight
style={styles.button}
onPress={() => this._handlePress(this.props.uniqueId)}>
<Text style={styles.buttonText}>
{this.props.uniqueId}
</Text>
</TouchableHighlight>
)
}
}
@geirman
Copy link
Author

geirman commented Oct 20, 2015

Here's the error I get now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment