react-hanger
react-hanger copied to clipboard
useNumber contains content of useArray
If I call the useNumber()
hook, it basically uses the code of useArray hook and returns me an array.
At source folder in the sub-directory array
is the file of the correct useNumber()
hook.
Oh lol. I'll take a look :) Or you can fix it with a PR :) Should be simple fix.
On Tue, Oct 8, 2019, 11:04 Maximilian Zinke [email protected] wrote:
If I call the useNumber() hook, that it simply uses the code of useArray hook and returns me an array.
At source folder in the sub-directory array is the file of the correct useNumber() hook.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kitze/react-hanger/issues/35?email_source=notifications&email_token=AA6B5342J5FHPYNTCIYQKWTQNRELDA5CNFSM4I6O7JC2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HQJG34Q, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6B533BSAZZFQAUP4X5VELQNRELDANCNFSM4I6O7JCQ .
@mxzinke okay, I looked. It's all good. It reuses /array/useNumber
version internally, to reuse the code. If I'm getting it right. So nothing is wrong I think. Clarify pls? Maybe some code example?
Okey I took a closer look and I was wrong. If I use the value of useNumber, then it returns NaN on decrease and on increase an Object-Array. I am not sure what is wrong on the code
@mxzinke maybe initial state is missing? Dunno, will be nice to find and fix the issue and then cover with tests. Codesandbox.io repro maybe?
It would seem this is currently happening in the demo? Every example of useNumber is broken in some way.
@RIP21 what about this one? not sure if we should close or fix something
@kitze I'll try to look at all my OSS issues this evening. It's been awhile :)
Hi guys, this issue exists because in onClick={counter.increase}
, the SyntheticEvent object
will be passed as param, so for increase it will be transformed into [Object object]
and NaN
for decrease.
Yup, sounds like true.