React provides the children
prop in which we can access other elements.
const Wrapper = ( { children } ) => { return ( <div> <h1>Wrapper</h1> {children} </div> ) } const ReactChildren = () => { return ( <Wrapper> <h2>Hello World</h2> <p>Content goes here..</p> </Wrapper> ) } export default ReactChildren;