Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
Quitar un componente externo al hacer clic en un botón

Soy nuevo en Reaccionar. Tengo los siguientes componentes en el área index.js React DOM

 ReactDOM.render( <React.StrictMode> <NavigationBar /> <App /> <Login /> </React.StrictMode>, document.getElementById('root') );

La barra de navegación se creó usando Bootstrap y cuando hago clic en el botón de búsqueda, quería que el componente fuera eliminado y reemplazado por el componente.

¿Cómo lo hago?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

necesita usar useState: cuando hizo clic en el botón, necesita cambiar el estado con onChange

 const [check, setCheck] = useState(false); ReactDOM.render( <React.StrictMode> <NavigationBar /> {check ? <App /> : anotherCoponent you want} <Login /> </React.StrictMode>, document.getElementById('root') );
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!