[chip] gets warning when I put inside <p> element
Problem description
React warning validateDOMNesting occurs when I put Chip element inside p element. hope Chip uses other than 'div' as containerElement. how about using 'span' instead?
Steps to reproduce
render() {
<p><Chip ... /></p>
}
javascript console says,
warning: validateDOMNesting(...): <div> cannot appear as a descendant of <p>. See DetailItem > p > ... > Chip > EnhancedButton > div.
Versions
- Material-UI: 0.15.2
- React: 15.2.1
- Browser: electron 1.2.5
I didn't tested much with 'span', but at least it works on my environment(and hopefully in chrome). I'll create PR for this if it seems okay to be changed.
The validateDOMNesting warning was expected when using <p> tags around the Chip component. Use <div> tag instead. @oliviertassinari Does the idea of making a PR to use to use span instead of div to make the Chip component seem okay to you? If yes, then I will make a PR, otherwise this is ready to be closed.
You should be able to use the containerElement property. However, the component doesn't allow it. You need to change the override order. Users should have the highest priority.
Sounds great to make a contribution! I'll make a PR to make containerElement configurable.