React Native Controlled Mentions Versions Save

Fully controlled React Native mentions component

v3.0.0-alpha.2

2 years ago

About Release

In that release was rethought and re-designed logic for rendering mentions, suggestions and core logic for parsing mention values. In fact, we have no need to render all this stuff in the MentionInput component. And more – we don't need the MentionInput component as well. It's enough to provide just a few props directly to the TextInput component.

Now you will be able to use hook for control mention state. The main idea – suggestions rendering now will be fully controlled by user and is extracted from MentionInput component.

Added

  • New useMentions hook that allows to render suggestions separately from TextInput component (#40, #44, #65, #75)
  • Ability to provide custom regex pattern (for example, david:123. #52, #70, #80)
  • Ability to use multiple characters triggers (for example @@, ## etc. #38, #51)
  • More examples for different cases (#67)

Fixed

  • Some unstable behavior with typed emojis in the TextInput (#66)

Breaking Changes

  • Change default trigger regex and mention value from @[David Tabaka](123) to {@}[David Tabaka](123)
  • Now custom regex patterns should have only one regex group
  • Removed containerStyle prop from the MentionInput component
  • Removed inputRef prop from the MentionInput component, use traditional ref now
  • Removed renderSuggestions and isBottomMentionSuggestionsRender from the PartType (new Config type)
  • Some refactored names:
MentionSuggestionsProps -> SuggestionsProvidedProps
onSuggestionPress -> onSelect
PartType -> Config
isTriggerPartType -> isTriggerConfig
getMentionValue -> getTriggerValue
replaceMentionValues -> replaceTriggerValues

How To Play

To play with this alpha pre-release, please switch to this branch for docs and examples. Also, you can install alpha version using next commands:

yarn add react-native-controlled-mentions@alpha
// or
npm install --save react-native-controlled-mentions@alpha

v2.2.4

3 years ago

FIXED

  • Error when value is null (#36)
  • Errors with regex named capture groups on iOS < 12 (#23) and Hermes (#37)
  • Wrong behavior on adding ) after mention part (#24)
  • Wrong behavior on adding emails (#41)

v2.2.0

3 years ago

ADDED

  • Ability to show mention suggestions for keywords with spaces (#25)

v2.1.0

3 years ago

ADDED

  • Ability to render mention suggestions at the bottom of text input (#27)

v2.0.0

3 years ago

Styling for custom patterns support

ADDED

  • partTypes property for defining a list of possible mention or pattern types for parsing (e. g. URLs) (#13)

BREAKING CHANGES

  • mentionTypes renamed to partTypes
  • MentionType changed to PartType which can be either MentionPartType or PatternPartType

New types defined in README.md.

v1.0.0

3 years ago

Hashtag support

BREAKING CHANGES

  • renderSuggestions, trigger, isInsertSpaceAfterMention, mentionTextStyle is now moved to mentionTypes property
  • 'Mentions' component now renamed to 'MentionInput'
  • mentionRegEx changed a little big

Please see the example app in /example folder to get more details.

FIXED

  • Wrong editing with keyboard auto-correction (#1)

ADDED

  • Support for multiple mention types (#9)
  • Jest tests support

v0.1.8

3 years ago

Fixed bugs:

  • inputRef undefined for Mentions #11

v0.1.7

3 years ago

New

  • add mentionTextStyle property (#9)
  • enchanted mention regex to accept word characters and "-" (#9)

Fixed

  • bug with adding mention on new line (#10)

v0.1.6

3 years ago

Fixed

  • add onSelectionChange forwarding (#8)

v0.1.5

3 years ago

Fixed

  • matchall error on old RN versions