Skip to content

Invalid hook call. Hooks can only be called inside of the body of a function component #42

Description

@PR1NCE-lab

using react -v : 18.2.0 because next js need react -v : 18.2.0 or above

after running npm run dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
info - Using external babel configuration from D:....\Reactjs\portfolio_website-main.babelrc
event - compiled client and server successfully in 5.4s (212 modules)
wait - compiling / (client and server)...
event - compiled client and server successfully in 2.7s (287 modules)
Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could
happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app
    See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions