Warning: validateDOMNesting(...): <button> cannot appear as a descendant of <button>.
See original GitHub issueI wrapped a component that is by another component. Essentially a StyledButton within a Button.
const StyledButton = styled(Button)
Below is Console log
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:12 (4 by maintainers)
Top Results From Across the Web
reactjs - validateDOMNesting(...): <button> cannot appear as a ...
I'm using Material-UI in my project, I'm getting a warning in the console ...
Read more >button cannot appear as a descendant of button
Let's say we're given the following mock from a designer to list files in rows. Alt Text. Each row should be clickable.
Read more >Warning: validateDOMNesting(...): <button> cannot appear as ...
Warning : validateDOMNesting(...): <button> cannot appear as a descendant of <button>. in button ; Project, Ring UI Library ; Priority, Normal N ;...
Read more >How to Prevent Nesting <button> Descendant Error in React
Everything works fine, page looks nice, but I noticed that an Error actually exists: validateDOMNesting(…): <button> cannot appear as a ...
Read more >warning: validatedomnesting(...): <button> cannot appear as a ...
But given your requirements you can make use of a basic button with react router dom history api. A simple example: import {Link,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@aakhan89 can you give an example code? This is a warning from
react
itself. As I understand you do something like this:which is not good. Because valid html does not support buttons within buttons… so what you want is most likely to be something like:
@aakhan89 Can you please post the root cause of your issue? I am running into the same error and I cannot find nested buttons anywhere in my code.