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

93
Views
I only want a div to display on screen depending on a boolean value

I only want a particular div to display if showHideClassName is set to the value of true. I have this code in my React application so that a div will either display or not depending on the status of showHideClassName:

render() {
    ...
    const showHideClassName = showPrompt ? 'show-div' : 'display-none';
        return (
            <div className={showHideClassName}>
                ...
            </div>
        );
}

The div is always visible though. Is there any way I can get this to work as I desire?

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

0

I don't have display-none in my css. Now that I've added the below, it works ad desired.

.display-none { display: none; }
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!