webscopeio / react-textarea-autocomplete

📝 React component implements configurable GitHub's like textarea autocomplete.
MIT License
454 stars 80 forks source link

flow-types to type.js file #31

Closed davidsonsns closed 7 years ago

davidsonsns commented 7 years ago

Issue #26 I think it's ready. waiting feedback. :smile:

davidsonsns commented 7 years ago

@jukben could help me with these errors?

already allocates defaultProps values with problems like {}, undefined, and null

jukben commented 7 years ago

@davidsonsns are you sure that you made you PR from top of the master? https://github.com/webscopeio/react-textarea-autocomplete/blob/master/src/Textarea.jsx#L55

I think we just need to define

value: '',
minChar: 1,
davidsonsns commented 7 years ago

I tuned, I forgot to run yarn test -- -u

jukben commented 7 years ago

@davidsonsns do we need to set the style and others to null? I don't think so if it possible we should stay with the previous implementation. Could you please check it?

P.S: Also you could install all-contributors and add yourself. (all-contributors add davidsonsns code). 🏅

davidsonsns commented 7 years ago

I get problems with lint if I do not set defaultProps for these props. By not being requireds. I'm watching the null props considered differently in getDefaultProps vs. isRequired #2166. What do you think about that?

jukben commented 7 years ago

@davidsonsns And when you strip the props also from PropTypes? Are you still getting errors?

davidsonsns commented 7 years ago

yes, linst returns me errors like: is missing in props validation react/prop-types

jukben commented 7 years ago

@davidsonsns I see. I've tried to myself and you are right. It's strange the errors occurs only when you use imported types if you define the type in the file itself is OK.

Could you please use undefined instead of null? I think is more appropriate. Otherwise, it looks fine. Just add yourself to the contributors and I'm going to merge it :)

davidsonsns commented 7 years ago

I agree with undefined. update performed :top: :tada:

jukben commented 7 years ago

Thanks for your contribution! ❤️