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

124
Views
¿Por qué {" "} se inserta automáticamente en mi aplicación React?

Tengo una aplicación React y, a veces, veo que {" "} se agrega automáticamente en mi código fuente. ¿Alguien puede ayudarme a entender por qué sucede esto? No está creando ningún error o error en la aplicación, ¿cuál es el motivo?

Por ejemplo:

 <div className="pr-form display-block"> <input type="radio" name="same" onChange={handleChange("create")} defaultValue={values.create} />{" "} Create a new requirement <br /> <input type="radio" name="same" onChange={handleChange("reuse")} defaultValue={values.reuse} />{" "} Reuse a draft <br /> <input type="radio" name="same" onChange={handleChange("existing")} defaultValue={values.existing} />{" "} Using an existing requirement </div>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Probablemente tenga instalado el complemento eslint-plugin-react, por lo que automáticamente agrega llaves a los espacios en blanco cuando se guarda el archivo. Alternativamente, podemos usar &nbsp; (espacios que no se separan), <span> </span> o \u00A0 Puede leer más sobre esta regla aquí rules/jsx-curly-brace-presence

Ejemplos de código correcto para esta regla:

 <Color text={"\u00a0"} /> <App>{"Hello \u00b7 world"}</App>; <style type="text/css">{'.main { margin-top: 0; }'}</style>; /** * there's no way to inject a whitespace into jsx without a container so this * will always be allowed. */ <App>{' '}</App> <App>{' '}</App> <App>{/* comment */ <Bpp />}</App> // the comment makes the container necessary
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!