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

183
Views
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 answers
Answer question

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 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!