Open
Description
Steps to reproduce:
- Here's my code below:
<MentionsInput singlieLine={false} value={description.value} onChange ={this.handleChangeStoryDescription}> <Mention trigger="@" data={ this.fetchUsers } /> </MentionsInput>
- in the fetchUsers call, I have the following:
fetchUsers = (query)=> { let users; console.log(query) if (!query) return axios.get(getUsers(query)).then( ({ data }) => { users = data.data.map((e, idx)=>{ let obj = { id: e._id, display: e.firstName + " " + e.lastName, } return obj }) return users // users is an array of objects formatted as per above }) .catch( ( error ) => { console.log( error ); }).then(function (users) { console.log(users) return users }); }
- My expectation is that the return of users to the this.fetchUsers function in the works as it does in this example - https://github.com/signavio/react-mentions/blob/master/demo/src/examples/AsyncGithubUserMentions.js. In other words, the data attribute in the should populate with the array of objects i.e. users