'Text strings must be rendered within a <Text> component, while importing a component into the main app the error appears

enter image description here[enter image description here][2]I'm importing a component as WelcomePage in my App.js, however, with only one simple line of Hello I have the error 'Text strings must be rendered within a component.' Anyone who knows why would be deeply appreciated.



Solution 1:[1]

In your App.js keep the WelcomePage inside a view

export default function App() {
  return (
   <View>
    <WelcomePage />
   </View>
  )
}

In your WelcomePage keep the Textinside a view

export default function WelcomePage() {
  return (
   <View>
    <Text>Hello</Text>
   </View>
  )
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sourav dey