Reputation: 3241
I want to create a component in React that I can use to wrap other tags and either display those child tags or alternate default content. A classic example is an authentication tag, that only shows the content after the user logs in.
What is this referred to in React and how do I get access to the child tags to show them or not?
Upvotes: 0
Views: 282
Reputation: 5289
You should read the documentation available about the children property. https://reactjs.org/docs/composition-vs-inheritance.html
Upvotes: 1