jwohlfert23 / react-native-tag-input

A simple React Native component that creates an input for tags, emails, etc.
MIT License
233 stars 105 forks source link

Make TagInput a "controlled" component by "lifting" text state #43

Closed Ashoat closed 7 years ago

Ashoat commented 7 years ago
  1. Lifts text state up to parent to enable more complex use cases
  2. Add a prop onChangeText that gets called whenever the text changes, and is used to update text prop, as well as to parse any new tags and update value accordingly
  3. parseTags and associated props (seperators, regex, and parseOnBlur) are removed in favor of having the client handle this logic themselves

More details in #39.

JaxGit commented 7 years ago

Please replace index.ios.js / index.android.js to index.js (from master and this branch) as it's the new default of RN 0.49

Ashoat commented 7 years ago

Please replace index.ios.js / index.android.js to index.js (from master and this branch) as it's the new default of RN 0.49

Okay, done: a77044ce15597e4112ebf09fcaffd028164172a9

How about also move and tweak the "default" parseTags invocation and function to this example?

Great idea! I went ahead and updated TagInputExample, but I got rid of the regex part since it was just a simple catch-all: c2a00d3e9fd44bd738367113cc72ba485846dd5a