Big Update Comming! v3.0.0-alpha.2 Pre-release Notes
Pre-release
Pre-release
dabakovich
released this
16 May 15:31
·
0 commits
to master
since this release
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 fromTextInput
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 theMentionInput
component - Removed
inputRef
prop from theMentionInput
component, use traditionalref
now - Removed
renderSuggestions
andisBottomMentionSuggestionsRender
from thePartType
(newConfig
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