0

Im using react-toastify but it throws an error about "Invalid Hook Call". here is my code:

enter image description here

and here is my error:

enter image description here

can anyone help me?

Daniel Firoozi
  • 100
  • 1
  • 10
  • Please don't share your code into a image, include it into your questions details with a proper format. See https://stackoverflow.com/help/how-to-ask – Jose Lora Nov 23 '21 at 15:17

2 Answers2

0

your code is working on codesandbox see this https://codesandbox.io/s/mystifying-snowflake-897rx?file=/src/App.js

try running the code without the context provider component and also try importing react in the same file.

Mohit Kushwaha
  • 1,003
  • 1
  • 10
  • 15
0

Make sure you install toastify for the correct folder (project folder). If it is installed in the wrong location, you can change the path using:

cd {folder name}

in the command line and then install toastify again.

F. Müller
  • 3,969
  • 8
  • 38
  • 49