peterp / react-native-tags

Tag input component for React Native
MIT License
288 stars 75 forks source link

Update #55

Closed WeWishYouHappiness closed 4 years ago

peterp commented 4 years ago

Hey there, thanks for this, could you let me know what the scope for the changes are here?

WeWishYouHappiness commented 4 years ago
  1. Deleted "componentWillReceiveProps" https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops.

  2. Fixed "Warning: This synthetic event is reused for performance reasons". Solved: event.persist();

  3. Added data validation.

      text.length > 1 &&
      this.props.createTagOnString.includes(text.slice(-1)) &&
      // words do not consist of separative characters, ex: "     ", ",,,,,,," etc.
      !text.match(new RegExp(`^[${this.props.createTagOnString.join("")}]+$`, 'g')) && 
      !(this.state.tags.indexOf(text.slice(0, -1).trim()) > -1)
  4. Update dependencies, examples and tests.

  5. Put input in a separate file.

peterp commented 4 years ago

Hey @abscess My apologies for taking so long to get back into this. I was focusing on some other project and would be interested in finding new maintainers.

I'm checking out this PR now.