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

170
Views
How to alternate between three texts being displayed on the same place with transition

I have three rows with the component Typography. I want to show the first row, then alternate to the second, then the third, and then back to the first one.

They should be displayed on the same place, and only one at a time.

<Typography>Welcome.</Typography> 
<Typography>Willkommen.</Typography>  
<Typography>Bem-vindo.</Typography> 
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

const Which = () => {
  const [which, setWhich] = useState(1);

  useEffect(() => {
        setTimeout(() => {
            setWhich(state => (state < 3 ? state + 1 : 1));
        }, 3000);
    }, []);

  return (
        <div>
            {
                which === 1 &&
                <div>Welcome</div>
            }
            {
                which === 2 &&
                <div>Willkommen</div>
            }
            {
                which === 3 &&
                 <div>Bem-vindo</div>
            }
        </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!