Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
Import files without adding .jsx at the end not working

I am working on a react project in which I have imported .jsx files without adding the extension .jsx at the end. But while I was trying to incorporate typescript files. It stopped identifying files unless the extension is added at the import statement.

import Item from "./Item"
//not working

import Item from "./Item.jsx"
//working

How can I fix this? where could the problem be? I use create-react-app

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

First of all, you have to add typescript into your project if you want to incorporate it. Now for the extension problem, you can add a webpack.config.js file and include the following in it:

{
    module.exports = {
        entry: './index.tsx',
        resolve: {
            extensions: ['', '.js', '.jsx', '.tsx']
        }
    }
}

this will enable you to import files without extensions.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda