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

218
Views
Delete `import React form 'react'` from components that don't need it(React 17 or higher)

I just noticed that in React 17 or higher we don't need to import react on top of each component so components like this:

import React from 'react'

export const Cmp = () => {
  return (
    <span> Text </span>
  )
}

can become this:

export const Cmp = () => {
  return (
    <span> Text </span>
  )
}

so here is my question: when upgrading some react project from below react-17 to react-17 or higher how can I tarnsoform all of my components and remove all unnecessary react import?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found a solution myself just take a look at this post https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports

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!