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

310
Views
what is difference Three-way operator( ~ ? a: b). and Alternative operator. in my code
<>
   {isLoading || <Loader />}
   <iframe
     ref={iframeRef}
     title="title"
     src={src}
     onLoad={onIframeLoad}
   />
</>

I wrote the code like this at first. this code is in react and with
const [isLoading, setIsLoading] = useState(true) and In the onIframeLoad func With other works, i doing setIsLoading(false)

so i think loader component i cant see but i can see iframe with loader ???

so i changed the code {isLoading || } => {isLoading ? : ''} then it work well

but i dont understand what is difference code meaning

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

0

<Loader /> component will be visible when isLoading is false in your code.

{isLoading || <Loader />} should be {isLoading && <Loader />}.

<>
   {isLoading && <Loader />}
   <iframe
     ref={iframeRef}
     title="title"
     src={src}
     onLoad={onIframeLoad}
   />
</>
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!