Complete the code to render the children inside the Box component.
function Box(props) {
return <View>{props.[1]</View>;
}The children prop contains the nested elements passed to a component in React Native.
Complete the code to wrap the children with a Text component inside the Wrapper.
function Wrapper([1]) { return <Text>{children}</Text>; }
Destructuring children from props allows direct use inside the component.
Fix the error in the code to correctly render children inside the container.
const Container = (props) => {
return <View>[1]</View>;
};The children prop is a React element or array, not a function, so it should be used without parentheses.
Fill both blanks to create a component that adds padding around its children.
function PaddedBox([1]) { return <View style={{ padding: 10 }}>{ [2] }</View>; }
Destructure children and render it inside the View to wrap nested elements with padding.
Fill all three blanks to create a component that conditionally wraps children with a border.
function BorderWrapper([1], [2]) { return ( <View style={{ borderWidth: [3], borderColor: 'black' }}> {children} </View> ); }
Destructure children and hasBorder props, then use a fixed border width to wrap children.