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

170
Vistas
Why does import operation works in the below react component?

Why does the below react work? As the function name in Hello.js component is Hello but it was not mentioned in main component that imported the Hello.js , Is it a property of arrow function?

The Hello.js component :

import React from 'react';
const Hello =() => <h1> HELLO <h1/>
export default Hello

Where Hello.js component got exported/ been Called.

import React from 'react';
import MyComponent from './Hello'
class App extends React.Component{
   render(){
     return(
            <div>
               <MyComponent />
            <div/>
           );
      }
 }
about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

This is called default export, you can name the component as you want when you import it.

But if you are using named export.

Ex:

export const something = 'something'

When you import it, you need to destruct the same name.

import { something } from 'file/path'

As @Felix, mentioned, you can give to named export another name ( in case there are naming conflicts )

Ex:

import { something as somethingElse } from 'file/path'

For more resources.

difference between named export and default export

about 4 years ago · Santiago Gelvez 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