Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

187
Vistas
The right way to import React

What is the right way to import React import React from 'react' or import react from 'react' as VSCode is giving the second one as Auto-suggestion .

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

Both work, it does not matter because you are getting the default export either way.

about 4 years ago · Juan Pablo Isaza Denunciar

0

There's no difference between the two examples you shared other than what you named the default export when you imported it. Either will work and are syntactically correct.

The standard convention is to Titlecase React when importing though:

import React from 'react';
about 4 years ago · Juan Pablo Isaza Denunciar

0

Because of separate jsx-runtime (https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) it it is not necessary to explicitly import React.

Just use named imports:

import type { FunctionalComponent } from 'react';
import { useState, useEffect } from 'react';
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda