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

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

0

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

about 4 years ago · Juan Pablo Isaza Report

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 Report

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