Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

The library doesn't support to update the tags in the input box if I pass tags as props or mutate those tags #106

Open
rhythm-sharma opened this issue Aug 12, 2022 · 2 comments

Comments

@rhythm-sharma
Copy link

Currently, the library supports only initialTags prop, The initial tags are functioning properly on the component mounting.

My usecase requires that, the tags should be shown to the input box both by typing manually and by sending them as props.

If you require more explanation of my usecase or anything else, let me know.

For this feature, I can also quickly create a pull request.

@peterp

@peterp
Copy link
Owner

peterp commented Aug 15, 2022

Hey @rhythm-sharma I'm not 100% sure I'm following, do you think this is something that others may appreciate? Perhaps it's possible to do without modifying the RN-tags package?

@rhythm-sharma
Copy link
Author

Hi @peterp,

Yes, others will value this and it will be beneficial.

This gives the user better flexibility to use the library because they can controls the tags from the outside of the library.

  1. What is my use case ?
    When a button is pressed, all I want to do is add tags to the input field, however the library does not currently support this.

  2. do others may appreciate ?
    Yes, as it offers developers the freedom to manage the tags array from outside of the library component. There are many operation that can be done from the outside to mutate the tags array.

  3. How to implement ?
    To support this feature, We can create a props name tags, and assign this value in the state and using componentWillReceiveProps check for the latest value of tags(prop). The implement would be more clear in the PR.

Let me know if you're convinced, and I'll quickly create PR.

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants