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

250
Views
Cómo formatear y devolver la cadena <style jsx> desde una función en React o Nextjs

Estoy tratando de encontrar una manera de "organizar" el componente de reacción como vue, donde se incluye con una sección diferente para HTML, JS y CSS.

Por ejemplo

 export default function HeaderExample() { return ( <> <h1>Hello World</h1> <style jsx>{` h1 { color: yellow; } `} </style> </> ) }

Quiero convertir a:

 export default function HeaderExample() { const compStyle = getStyle(); return ( <> <h1>Hello World</h1> <style jsx>{compStyle} </style> </> ) } function getStyle() { return ` h1 { color: yellow; } ` }

Funciona, pero escribirlo es bastante difícil porque no hay resaltado de sintaxis ni nada.

¿Es una buena convención en general?

¿Y hay alguna manera de habilitar la ayuda de resaltado/formato de sintaxis para este tipo de cosas? ¿Y debería funcionar también con SCSS o PostCSS?

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!