Override element type in React

140 Views Asked by At

I have two nested Patternfly 4 components, specifically DualListSelector that uses TreeView as its items. My problem is that both these contain <button> and I am seeing those

Warning: validateDOMNesting(...): <button> cannot appear as a descendant of <button>.

errors in console. I was looking through the sources for these components but it seems I can't configure either places to use a different element type; is there any hack to override it?

(Note: I know that DualListSelector supports tree view natively, but the behaviour had some shortcomings in my use case that led me to do the tree view on my own.)

0

There are 0 best solutions below