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

1.9K
Views
¿Cómo puedo actualizar 'palabras' y recuperar UseTypewriter?

Intenté actualizar las palabras de la matriz en handleEnter mediante setWord() y poner {text} en un nuevo div . Pero no funciona. {text} no se actualizó.

 import { Typewriter, useTypewriter, Cursor } from 'react-simple-typewriter' import './terminal.css'; function Terminal() { let initialWords = [ 'Welcome to Blabla', '#EnjoyToTheFuture!', '', "I'm going to ask you some questions...are you ready? (y / n)" ] const [word, setWord] = useState(initialWords); const [wrap, setWrap] = useState(false); const {text} = useTypewriter({ words: [word[0], word[1], word[2], word[3]], loop: 1, typeSpeed: 100, cursor: true, },); const handleEnter = (e) => { if (e.key === 'Enter') { let newWords = ['Test'] setWord(newWords); setWrap(true); } } return ( <div className='m-3 p-3 terminal-cont rounded border '> { !wrap ? ( <div className='text-white h5 text'>{text} { text !== word[3] && <Cursor cursorStyle='_' /> } { text === word[3] && <input className='input px-2' type='text' autoFocus onKeyDown={handleEnter}></input> } </div> ): ( <div className='text-white h5 text'> {text} </div> ) } </div> ); } export default Terminal;
about 4 years ago · Juan Pablo Isaza
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!