-
Notifications
You must be signed in to change notification settings - Fork 276
Description
Describe the Feature
React Native renderer throws error when string is rendered outside of Text
component, e.g. directly under View
or other native component. It seems that React Test Renderer that we use does not throw a similar error in this situation, which may lead to missed errors that RNTL could capture in tests.
This feature would emulate that behaviour by throwing error whenever string value is rendered outside of Text
component.
Possible Implementations
As a first step we could analyse render tree after initial render and look for string
children
prop that are not children of Text
component.
Then we would have to figure out a way to react to subsequent re-renders to trigger the validation again. Maybe a custom act
wrapper that would invoke the validation.
Related Issues
This feature request is based on #556