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

267
Views
How to transition an element that does not exist on the DOM yet

Now I have code like this

  {data.inventoryOn === true ? (
      <div className="inventoryOptions flex__container-v">
        <Link to="listofmedicines" style={{ textDecoration: "none" }}>
          <div className="inventoryoption">
            <p className="p__poppins">List Of Medicines</p>
          </div>
        </Link>
        <Link to="medicinegroups" style={{ textDecoration: "none" }}>
          <div className="inventoryoption">
            <p className="p__poppins">Medicines Groups</p>
          </div>
        </Link>
      </div>
    ) : null}
    {data.spaceBelow ? <div className="space" /> : null}

as you might have noticed for the code to appear it depends on some state value to be true.

My question is how do I get it to appear smoother. I cant transition it because I don't know the property like background or color or something else. And the content is not hidden for me to transition using opacity since it is completely not available when the state value is not true.

how can I achieve this?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

If you insist to use conditional rendering , you can use css animation and onAnimationEnd prop according to react, there is an implementation in this snippet

about 4 years ago · Santiago Gelvez 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!