Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
Integrated component for user and non-user or 2 separate components?

My App/website will have the same components for registered users and and non-registered users. Except that they behave a little differently.

What is the industry standard way to design this?

To create 2 separate components? Or to create 1 integrated component?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If the components is not drastically changes than i suggest keeping the same components as change their click functionally accordingly though a if statement.

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda