timelessco / chakra-components

Components built on top of Chakra UI
MIT License
1 stars 0 forks source link

[ComboBox] Type Fixes in component #69

Closed navin-moorthy closed 4 years ago

navin-moorthy commented 4 years ago

There are a few open source standards that we generally do, even at times when certain things are obvious to avoid breaking the code. These are done generally when typescript is not used.

  1. Type check once, for every function by typeof x == 'function'. Example, this shouldn't be an error. Instead a default filter function should load. image

  2. Same way for all functions. I could see this being there in the source at few places. Should extend it everywhere.

Originally posted at issue

navin-moorthy commented 4 years ago

Should we type check every props we get from outside the components? image

navin-moorthy commented 4 years ago

For options, I have checked if the given options are Array of Object, image

I think it's the responsibility of those who use the component to give a valid opitons. Now the component doesn't break on invalid values

prasanna1211 commented 4 years ago

Yes, I agree with that. Just that ensure functions are covered for cases that don't break the component.

navin-moorthy commented 4 years ago

Sure, I am checking all the where the component can break because of the types and fixing it.

navin-moorthy commented 4 years ago

As per my knowledge, I have fixed most of the cased except for the below props, image

I will keep this issue and pull request open until I write the docs and write examples using the above props.