I have been struggling with this code for a while now. I tried using array map to display content in react native view but keeps throwing errors which I already handled.
function AppSlim() {
//const todos = useSelector(state=>state.TodoList).list;
const todos = ['Hello', 'Michael']
console.log('slim todos',todos);
return (
<View style={styles.container}>
<MyBtn />
<MyModal />
<View>
{/* {alert("hi")} */}
{console.log('todos',todos)}
{todos.map((item)=>(<Text key={item}>{item}</Text>))};
{/* <Text>Hi</Text>
<Text>Mike</Text> */}
</View>
</View>
);
}
I have been battling with this issue for quite some time and I can't see what is wrong with my code. And I get the error:
Text strings must be rendered within a <Text> component.
What I'm I missing please?