react-tag-input-component
react-tag-input-component copied to clipboard
Bug: types for value is optional but actually required
trafficstars
https://github.com/hc-oss/react-tag-input-component/blob/861e4e760d080d418724bd63d84e9288617ff082/src/index.tsx#L47
Here the code seems considered undefined value but below code makes the tags undefined and make throw error.
https://github.com/hc-oss/react-tag-input-component/blob/861e4e760d080d418724bd63d84e9288617ff082/src/index.tsx#L53-L57
IMO current code is not support uncontrolled component, so it would be good to have value and onChange props required
Someday for uncontrolled component may be form of
<form onSubmit={(e) => {
e.preventDefault();
const formData = new FormData(e.currentTarget);
const tags = formData.get("tags"); // should be such like ["banana", "apple"]
}}>
<TagsInput name="tags" />
</form>