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

405
Views
TypeError: (0 , Rt.useState) is not a function

Before marking as duplicate, I've searched a lot and there was no answer.

I'm making a react project. When on development environment, everything works just fine. Then when I build react, there is this error in the browser:

TypeError: (0 , Rt.useState) is not a function at react-dom.production.min.js:209

On the internet I've searched a lot. Everyone would refer to version 16.7 which has no hooks. I have version 16.14 though! Take a look at the dependencies:

{
  "qs": "^6.10.2",
  "react": "^16.14.0",
  "react-content-loader": "^6.1.0",
  "react-dom": "^16.14.0",
  "react-intersection-observer": "^8.33.1",
  "react-qr-reader": "^2.2.1",
  "react-router-dom": "^5.3.0",
  "react-scripts": "5.0.0",
  "react-swipeable-list": "^1.4.0",
  "react-tiger-transition": "^4.1.2",
  "react-toastify": "^8.1.0",
  "react-transition-group": "^4.3.0"
}

I've checked for a duplicate in react. I used npm ls react and npm ls react-dom

Here's the results of these two:

> npm ls react

+-- react-content-loader@6.1.0
| `-- react@16.14.0 deduped
+-- react-dom@16.14.0
| `-- react@16.14.0 deduped
+-- react-intersection-observer@8.33.1
| `-- react@16.14.0 deduped
+-- react-qr-reader@2.2.1
| `-- react@16.14.0 deduped
+-- react-router-dom@5.3.0
| +-- react-router@5.2.1
| | +-- mini-create-react-context@0.4.1
| | | `-- react@16.14.0 deduped
| | `-- react@16.14.0 deduped
| `-- react@16.14.0 deduped
+-- react-scripts@5.0.0
| `-- react@16.14.0 deduped
+-- react-swipeable-list@1.4.0
| `-- react@16.14.0 deduped
+-- react-tiger-transition@4.1.2
| `-- react@16.14.0 deduped
+-- react-toastify@8.1.0
| `-- react@16.14.0 deduped
+-- react-transition-group@4.4.2
| `-- react@16.14.0 deduped
`-- react@16.14.0

and the other one:

> npm ls react-dom

+-- react-dom@16.14.0
+-- react-qr-reader@2.2.1
| `-- react-dom@16.14.0 deduped
+-- react-swipeable-list@1.4.0
| `-- react-dom@16.14.0 deduped
+-- react-toastify@8.1.0
| `-- react-dom@16.14.0 deduped
`-- react-transition-group@4.4.2
  `-- react-dom@16.14.0 deduped

So we can say that there is not a duplicate!

Syntax is probably correct, since it works just fine in development.

I'm so confused. Thank you.

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

0

#SOLVED Issue was because vs code intellisense automatically added this :

import { useState } from 'react/cjs/react.development.js'

instead of

import { useState } from 'react'

Killed me to find it :/

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!