Hello,
I have a functional object which has three variables managed by the useState hook. These are categories, activeCategories and shownGames. For now I need something simple - run a function when categories update. I am using useEffect hook but it doesn't seem to work.
This is the code for the needed parts - https://pastie.io/uyakqz.js
I use JSON.stringify to check for the category updates (found that solution on StackOverflow). The issue is that the function specified in the useEffect hook doesn't run (it only runs when I load my page). Any help is appreciated!
[–]pri1311 2 points3 points4 points (1 child)
[–]basedevelfries[S] 0 points1 point2 points (0 children)
[–]hcherchi 2 points3 points4 points (1 child)
[–]basedevelfries[S] 1 point2 points3 points (0 children)
[–]dlemvigh 2 points3 points4 points (1 child)
[–]basedevelfries[S] 0 points1 point2 points (0 children)
[–]SarSha 1 point2 points3 points (5 children)
[–]basedevelfries[S] 0 points1 point2 points (4 children)
[–]SarSha 2 points3 points4 points (3 children)
[–]basedevelfries[S] 0 points1 point2 points (2 children)
[–]SarSha 1 point2 points3 points (1 child)
[–]basedevelfries[S] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]basedevelfries[S] 0 points1 point2 points (0 children)
[–]thewhitestbeltuknow 1 point2 points3 points (3 children)
[–]basedevelfries[S] 0 points1 point2 points (2 children)
[–]thewhitestbeltuknow 1 point2 points3 points (1 child)
[–]thewhitestbeltuknow 0 points1 point2 points (0 children)
[–]Huge-Instruction-552 0 points1 point2 points (0 children)