What is the type of <Text>
's children property in React Native?
Let's say, I'm creating component that is HOC over the <Text>
, and I want to support all the same children types as a normal <Text>
.
type Props = { children: ???;}const MyText = ({children}: Props) => <Text>{children}</Text>
The type cannot be just a string
since React Native's <Text>
supports also component nesting, fragments, and arrays as children.