I have a NetCore2 app with ReactJS installed.
My React app does something like this ->
- User inputs into a field
- axios makes a call to an api to get the user and/or list of users
- The input field shows suggestions based on what was saved in PeopleList state.
I'm using Office Fabric UI React - People Picker (in case it matters).
My problem here is that i have no idea how i could use async/await in my code.
If i put something like this
async asynconFilterChanged = (filterText, currentPersonas, limitResults) => {
VS Code throws an error telling me that async is only for .ts files. Also if i use await in any other functions i will get an error such as await is a reserved word
.
As far as i know async/await is not TS only...(or am i wrong?).
I'm using the older Babel with the ENV preset.
Let me know if i need to provide more code, but TLDR what i want is to only start the filter function after my axios is done pushing items into the PeopleList state (array of objects).
Thanks!