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

164
Views
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 answers
Answer question

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 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!