Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning from the React DOM library. he warning is saying that you are trying to add an h5 element as a child of an h2 element. This is not allowed because h5 elements can only be children of h1 elements. #3

Open
shiva-karthick opened this issue Jul 18, 2023 · 0 comments

Comments

@shiva-karthick
Copy link
Owner

The error from the developer tools is,
react-dom.development.js:86 Warning: validateDOMNesting(...): <h5> cannot appear as a child of <h2>. at h5 at http://localhost:3000/static/js/bundle.js:14851:66 at Typography (http://localhost:3000/static/js/bundle.js:45749:87) at http://localhost:3000/static/js/bundle.js:14851:66 at h2 at http://localhost:3000/static/js/bundle.js:14851:66 at Typography (http://localhost:3000/static/js/bundle.js:45749:87) at http://localhost:3000/static/js/bundle.js:14851:66 at DialogTitle (http://localhost:3000/static/js/bundle.js:28991:82) at http://localhost:3000/static/js/bundle.js:14851:66 at div at http://localhost:3000/static/js/bundle.js:14851:66 at Paper (http://localhost:3000/static/js/bundle.js:37896:83) at http://localhost:3000/static/js/bundle.js:14851:66 at div at http://localhost:3000/static/js/bundle.js:14851:66 at Transition (http://localhost:3000/static/js/bundle.js:160452:30) at Fade (http://localhost:3000/static/js/bundle.js:29427:77) at FocusTrap (http://localhost:3000/static/js/bundle.js:16558:5) at div at http://localhost:3000/static/js/bundle.js:14851:66 at Portal (http://localhost:3000/static/js/bundle.js:17943:5) at Modal (http://localhost:3000/static/js/bundle.js:16896:7) at Modal (http://localhost:3000/static/js/bundle.js:36713:82) at http://localhost:3000/static/js/bundle.js:14851:66 at Dialog (http://localhost:3000/static/js/bundle.js:28228:83) at CustomModal (http://localhost:3000/static/js/bundle.js:5006:5) at div at http://localhost:3000/static/js/bundle.js:14851:66 at Toolbar (http://localhost:3000/static/js/bundle.js:44703:82) at header at http://localhost:3000/static/js/bundle.js:14851:66 at Paper (http://localhost:3000/static/js/bundle.js:37896:83) at http://localhost:3000/static/js/bundle.js:14851:66 at AppBar (http://localhost:3000/static/js/bundle.js:23849:83) at http://localhost:3000/static/js/bundle.js:14851:66 at div at http://localhost:3000/static/js/bundle.js:14851:66 at Navbar (http://localhost:3000/static/js/bundle.js:5218:82) at div at http://localhost:3000/static/js/bundle.js:14851:66 at Box (http://localhost:3000/static/js/bundle.js:49572:72) at http://localhost:3000/static/js/bundle.js:14851:66 at LocalizationProvider (http://localhost:3000/static/js/bundle.js:54722:19) at ThemeProvider (http://localhost:3000/static/js/bundle.js:48404:5) at ThemeProvider (http://localhost:3000/static/js/bundle.js:48789:5) at ThemeProvider (http://localhost:3000/static/js/bundle.js:46824:14) at StyledEngineProvider (http://localhost:3000/static/js/bundle.js:48583:5) at App (http://localhost:3000/static/js/bundle.js:152:56) at Profiler (http://localhost:3000/static/js/bundle.js:81746:5) at profiler(App) at RenderedRoute (http://localhost:3000/static/js/bundle.js:159526:5) at Routes (http://localhost:3000/static/js/bundle.js:160077:5) at Router (http://localhost:3000/static/js/bundle.js:160015:15) at BrowserRouter (http://localhost:3000/static/js/bundle.js:158265:5) at CourseContextProvider (http://localhost:3000/static/js/bundle.js:10707:5) at AppContextProvider (http://localhost:3000/static/js/bundle.js:10542:5) at Root.

The error message you provided is a warning from the React DOM library. The warning is saying that you are trying to add an h5 element as a child of an h2 element. This is not allowed because h5 elements can only be children of h1 elements.

The error message also shows the stack trace, which shows you the path that the code took to reach the error. This can be helpful for debugging the error.

To fix the error, you need to change the way that you are rendering the h5 element. You can either change the parent element to an h1 element, or you can use a different element altogether.

Here is an example of how you could fix the error:

// Instead of this:
<h2>
  <h5>This is an h5 element</h5>
</h2>

// Do this:
<h1>
  <h5>This is an h5 element</h5>
</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant