Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

406
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda