Can React Native’s Yellowbox be ignored?

Asked

Viewed 134 times

-1

At some points in my application, React has errors in Yellow Box, for example:

Each Child in a list should have a Unique "key" prop.

I know it’s possible to disable them, but can it cause any problems in my app? If I don’t disable and manage the APK, this by compromising the application in some way?

  • 1

    Even if turn off does not mean it will fix the problem that you this ignoring, which is the duplicity of Ids on the list, having duplicate Ids will cause problems in your program, problems that you can’t imagine, ID is forever be unique, fix this and the yellow box will disappear as if by magic.

  • The ideal is to correct these warnings, most of the time are warnings about things that can cause performance problems, misuse of Hooks or something deprecated

  • post code, but, has been well reported because the list needs to be unique in the interaction and each item needs to have a key different ... post the code

1 answer

2


React Native’s Yellow Boxes are system warning messages. They are warnings or information that the RN informs you saying that something may be with a problem, but that is not preventing the execution of the application.

Different from the Red Box that will break the application and will not allow the APK to be generated or run.

Each child in a list should have a unique "key" prop. In this case for example the RN is asking for a single key for the items of a list that is not being passed. This will not prevent the list from being rendered, but occasionally can bring problems to the application, since it would be recommended for each item in the list to have an identifier key.

You can generate an APK with Yellow box or run the application. But the recommended would be to treat these problems.

Another thing about Yellow Box and that you can also use them for your own logs with the command console.warn()

You can disable Yellow Box’s by using console.disableYellowBox = true;

If you want to know more you can read this debug page from documentation who has more information.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.