In typescript interface, we can define, like :
export interface ViewContainerProps { style?: ViewStyle | ViewStyle[]; children?: React.ReactNode aString:string aNumber:number}
I want to write a custom top-level <View>
, to cover all screen, it look like this:
const VIEW_CONTAINER: ViewStyle = { width: windowWidth, height: windowHeight,};export interface ViewContainerProps { style?: ViewStyle | ViewStyle[]; children?: React.ReactNode ///no , something wrong}export const ViewContainer = (props: ViewContainerProps) => { const {style, children} = props; return <View style={[style, VIEW_CONTAINER]}>{children}</View>;};
And i want to children return React component
to interact and do anything that a react component do, what type of React can i put in typescript interface? I read some docs , say that React.reactNode a light, stateless, immutable, virtual representation of a DOM node
, feel like it not what i want when create top-level components that wrap all child components
Please help, thank you a lots