0 votes
in ReactJS by
What is strict mode in React?

1 Answer

0 votes
by

React.StrictMode is a useful component for highlighting potential problems in an application. Just like <Fragment>, <StrictMode> does not render any extra DOM elements. It activates additional checks and warnings for its descendants. These checks apply for development mode only.

import React from 'react'

function ExampleApplication() {

  return (

    <div>

      <Header />

      <React.StrictMode>

        <div>

          <ComponentOne />

          <ComponentTwo />

        </div>

      </React.StrictMode>

      <Footer />

    </div>

  )

}

In the example above, the strict mode checks apply to <ComponentOne> and <ComponentTwo> components only.

Related questions

0 votes
asked Dec 18, 2023 in ReactJS by rahuljain1
0 votes
asked Sep 10, 2023 in VueJS by DavidAnderson
...