import { View, Text, StyleSheet, Pressable } from 'react-native'; import React from 'react'; import { useRoute } from '@react-navigation/native'; import type { DataCard } from './CardsSabiasQue'; export const InformacionSabiasQue = () => { const route = useRoute(); const [data, setData] = React.useState(route.params.key); React.useEffect(() => { setData(route.params.key); console.log(data); // eslint-disable-next-line react-hooks/exhaustive-deps }, [route.params.key]); return ( {data && data.map((item, key) => ( {item.title} {item.text} ))} Regresar ); }; const styles = StyleSheet.create({ container: { marginBottom: 40, marginHorizontal: 20, marginTop: 20, }, container1: { marginBottom: 40, marginHorizontal: 20, marginTop: 20, }, title: { fontSize: 20, fontWeight: 'bold', }, text: { marginTop: 10, fontSize: 18, }, button: { backgroundColor: 'yellow', width: '100%', height: 50, borderRadius: 10, justifyContent: 'center', alignItems: 'center', color: 'black', marginTop: 20, }, });