Home > other >  React Native - Text must be rendered withing a <Text> component
React Native - Text must be rendered withing a <Text> component

Time:05-27

I am m trying to write an app that just saves and holds data, and I am getting the following error.

Unexpected text node: . A text node cannot be a child of a < View >. (On Chrome DevTools)

Text must be rendered withing a component (On Expo Go simulations)

From what I understand there is a " " (as in the space character) SOMEWHERE in the code and it wont work because of that, but I have completely no clue where the space can be, as prettier just puts spaces everywhere on its own to style stuff.

It runs fine in the web, but I need it to work on iOS, and when I try to simulate it, this error stops the entire app.

Here is a link to snack.expo with a stripped down version of what im trying to make: https://snack.expo.dev/@vevlex/stringintext

(Right now there is an error because the ID of the added jobs is the same, I'm aware of that and I just didn't get around to doing that yet)

CodePudding user response:

Remove {""} in App.js. We need to use {/**/} for comments.

  • Related