Skip to content

Instantly share code, notes, and snippets.

@WallysonGalvao
Last active June 21, 2020 18:25
Show Gist options
  • Save WallysonGalvao/b6e055a02fc2c911192b1c4470c52b74 to your computer and use it in GitHub Desktop.
Save WallysonGalvao/b6e055a02fc2c911192b1c4470c52b74 to your computer and use it in GitHub Desktop.
Marvelapp
import React from "react";
import { StyleSheet, View, Text } from "react-native";
import { useNavigation, useRoute } from "@react-navigation/native";
interface IParams {
character: {
name: string;
alterEgo: string;
imagePath: string;
biography: string;
caracteristics: {
birth: number;
weight: {
value: number;
unity: string;
};
height: {
value: number;
unity: string;
};
universe: string;
};
abilities: {
force: number;
intelligence: number;
agility: number;
endurance: number;
velocity: number;
};
movies: string[];
};
}
const Detail = () => {
const navigation = useNavigation();
const route = useRoute();
const routeParams = route.params as IParams;
const { character } = routeParams;
return (
<View style={styles.container}>
<Text>{JSON.stringify(character)}</Text>
</View>
);
};
export default Detail;
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment