WrathChaos / react-native-bouncy-checkbox-group

Fully customizable bouncy checkbox group for React Native
https://freakycoder.com/
MIT License
24 stars 9 forks source link

Type of id doesn't need to be number #2

Closed SrBrahma closed 2 years ago

SrBrahma commented 2 years ago

https://github.com/WrathChaos/react-native-bouncy-checkbox-group/blob/ff0c2dfeb4a7939bfc66f4cb9e348b9ba32fd9ad/lib/BouncyCheckboxGroup.tsx#L15

keys may be strings!

WrathChaos commented 2 years ago

Can you describe it with a valid reason?

SrBrahma commented 2 years ago

I have three checkboxes, each one with a value: 'single', 'multi', 'many'. With onChange, I simply get the id (one of those 3 values) and change my forms value directly.

Without it, I would need a translator of the number id to the string id. It's doable, but it's an extra step not needed at all. What I am doing in my fork is exactly this.

jacksonHendric commented 2 years ago

Any progress on this? Id needs to be string | number Should be an easy fix. Also why does onChange give me all properties of the radio button? It should just be id and text

WrathChaos commented 2 years ago

Any progress on this? Id needs to be string | number Should be an easy fix. Also why does onChange give me all properties of the radio button? It should just be id and text

Please check the PR comment :) I love to merge this but there are some issues. We can make it string | number but there are other issues as well

WrathChaos commented 2 years ago

Version 0.1.1 is published with these changes