79335931

Date: 2025-01-07 12:10:11
Score: 1
Natty:
Report link

I had encountered a similar problem and after banging my head for 2 hours I found the solution to be quite simple. This error is being occurred because you shouldn't use hooks like state inside loops. Instead try to go for local variables. Also if you are handling promises or getting async data which cannot be handled through variables then create a separate component for that and then you can successfully use your hooks inside map function or loops without getting any error.

Reasons:
  • Whitelisted phrase (-2): I found the solution
  • Contains signature (1):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Sid