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

173
Views
¿Componente integrado para usuario y no usuario o 2 componentes separados?

Mi App/sitio web tendrá los mismos componentes para usuarios registrados y no registrados. Excepto que se comportan un poco diferente.

¿Cuál es la forma estándar de la industria para diseñar esto?

¿Para crear 2 componentes separados? ¿O para crear 1 componente integrado?

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

0

Si los componentes no cambian drásticamente, sugiero mantener los mismos componentes y cambiar su clic funcionalmente en consecuencia a través de una declaración if.

 const [comment, updateComment] = useState("") const isLogin = false // should come from some global state managment(ex : redux) handleClick = () => { if (isLogin) { // Post a comment } else { // Redirect to login page } } return <div> <input type="text" value={comment} onChange={e => updateComment(e.target.value)} /> <button onClick={handleClick}> Post a comment</button> </div>;

}

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!