Skip to content

Instantly share code, notes, and snippets.

@AllanGraves
Created February 1, 2021 21:56
Show Gist options
  • Save AllanGraves/1702d3633d782e556086b0863d577ad7 to your computer and use it in GitHub Desktop.
Save AllanGraves/1702d3633d782e556086b0863d577ad7 to your computer and use it in GitHub Desktop.
const LocationScreen = ({route, navigation}) => {
let variables = route.params.story.variables;
useEffect(() => {
/* Override variables passed in with anything loaded from AsyncStorage */
variables = getData(route.params.storyID, variables);
}, []);
console.log('LocationScreen: ' + JSON.stringify(variables));
return (
<ScrollView>
<View style={styles.centeredView}>
<Location
jsondata={route.params.story.locations}
locationID={route.params.locationID}
key={route.params.storyID}
variables={variables}
navigation={navigation}
storyID={route.params.storyID} /* TODO - make this a global context */
/>
</View>
</ScrollView>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment