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

215
Views
¿Cómo puedo importar un archivo JS con caracteres especiales en su nombre en React y JSX?

¿Cómo puedo importar un archivo JS con caracteres especiales en su nombre en React y JSX?

puedo

import { tomorrow} from 'react-syntax-highlighter/dist/esm/styles/hljs';

(la carpeta contiene mañana.js y mañana-noche.js)

pero no puedo:

import { tomorrow-night} from 'react-syntax-highlighter/dist/esm/styles/hljs';

No creo que la desestructuración funcione aquí porque es una declaración de importación.

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

0

puedes probar como

 import * as Highlighter from 'react-syntax-highlighter/dist/esm/styles/hljs'; const TomorrowNight = Highlighter[`tomorrow-night`];
about 4 years ago · Juan Pablo Isaza Report

0

¿Qué tal usar import * as blah import? Eso le da un objeto en el que luego puede buscar cualquier cadena.

 import * as tmrw from from 'react-syntax-highlighter/dist/esm/styles/hljs'; const tmrw_night = tmrw['tomorrow-height']
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!