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

408
Vistas
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 Respuestas
Responde la pregunta

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