Wrapper Components
Using Wrappers to handle UX/style variations
For Handling Wrapper <div>
’s and other markup around component, use composition!
When you create a React component instance, you can include additional React components or JavaScript expressions between the opening and closing tags. Parent can read its children by accessing the special this.props.children prop.
FYI - Wrapper component can also be made accept a tag name and then used to generate the HTML element. However, usually this is not recommended because you can't add attributes/props to it.
Related links:
Last updated
Was this helpful?