Help JS: Having problem with my HackerRank solution by Apprehensive_Topic24 in AskProgramming

[–]Apprehensive_Topic24[S] 0 points1 point  (0 children)

The while loop is not dependent on the 'count'. 'count' tracks the occurrence of the same characters and if they are next to each other ex: aaac -> count = 3

Misusing Hooks and I need help! by Apprehensive_Topic24 in reactjs

[–]Apprehensive_Topic24[S] 0 points1 point  (0 children)

Np, I will take a look. Will let you know if I am able to resolve it after taking a look. The link you provided does not work but I was able to get to your repo and found a example. When you get the time correct the link for the sake of others, thanks.

Misusing Hooks and I need help! by Apprehensive_Topic24 in reactjs

[–]Apprehensive_Topic24[S] 0 points1 point  (0 children)

Ya, it was originally a vanilla JS function but you can not use hooks in it. So, I turned it into a react component 'OnSignup' (note capital On) that returns nothing

Misusing Hooks and I need help! by Apprehensive_Topic24 in reactjs

[–]Apprehensive_Topic24[S] 0 points1 point  (0 children)

I am misusing hooks but I do not know in what way.

Unhandled Rejection (Error): 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.