When I see sample react component usecase,for example following is listed.
But I have questions.<App /> means some react component and it has some html element.
But regarding <Theme></Theme> , it is also react component. but why this is different writing form from <App />? what is the difference between them?
<BrowserRouter>
<Theme>
<App />
</Theme>
</BrowserRouter>
I am totally novice of React,and search them but I still have unclear about it. If someone has materials relating that. Will you please let me know
thanks
If you define component that have children in props, you should use it as pair tag, and whatever is inside of it, its passed to props.children.
In your example imagine that Theme can look somehow like this:
const Theme = ({children}) =>{
return <div style={{backgroundColor: red, color: blue}}>
{children} //this is where <App /> is rendered in your case
</div>
}