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

161
Visualizações
Typescript isolatedModules `export type { T } from './file'` vs `export { type T } from './file'` syntax

When I copied some code from one of my create-react-app projects to another. I've got these kind of errors:

SyntaxError: .../index.ts: Unexpected token, expected "," (3:47)

> 3 | export { default, type TimeInputProps } from "./TimeInput";
    |                        ^

The error is gone after changing the line to:

export { default } from "./TimeInput";
export type { TimeInputProps } from "./TimeInput";

One project works with both syntaxes but the other one only accepts the second syntax. Typescript version is 4.7.4 in both. What is the reason for it? Is there any difference? Couldn't find any documentation on it.

about 4 years ago · Juan Pablo Isaza
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