Reputation: 180
I am trying to put a react-bootstrap carousel in each React material-UI tab.
And I got the error Warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>
. Where should I fix?
I have copy all my codes on github, due to the length restrict of stackoverflow.
Upvotes: 0
Views: 1884
Reputation: 36
I had the same problem,kept looking for root p but there was none. Then i had the idea to look up tabPanel function and inside the box there was
<Typography>{children}</Typography>
just change the tag from typography to a div or an empty div and the warning will disappear
Upvotes: 2
Reputation: 98
Try adding the attribute
component={span}
In material UI components that is nested.
Upvotes: 1