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

152
Views
react implement condition to show and hide

There are two textbox JO and PO

  1. If user both should hide.
  2. If admin hide JO and show PO.
  3. if superadmin show both

Need to implement above logic in react or javascript?

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

0

If i understand your question correctly you can do like this:

If i understand your question correctly you can do like this:



 const role = getRole()

{(role !== "user" && role !== "admin") || role==='superadmin' && <TextBoxJo />}
{(role !== "user" && role === "admin") || role==='superadmin' && <TextBoxPo />}

you can even put these conditions and use that function, there are multiple ways to do this.

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!