Esempio n. 1
0
 this._onInputChange = (editorState) => {
   this.setState({
     defaultValue: editorState
   });
   if (typeof this.props.onTextChange === 'function') {
     const mentions = getMentions(editorState).map((mention) => {
       const email = mention.replace('@[', '').replace(']', '');
       const member = this.props.members.find(m => m.email === email);
       return {
         mention,
         matcherId: (member && member.id),
       };
     });
     this.props.onTextChange(toString(editorState), mentions);
   }
 };
 onChange = (editorState) => {
   console.log('>> mentionChange',
     toString(editorState, { encode: true }),
     getMentions(editorState, ['@', '#'])
   );
 }