Closed VernitaJ closed 4 years ago
On the first render, all users should appear, until onChange is fired. At the moment, on first render, the screen just says 'Loading...'
On the first render, all users should appear, until onChange is fired. At the moment, on first render, the screen just says 'Loading...'
Yeah I know, I put some comments on HomeView where I'm managing the state. Not sure how to solve it because I thought this was enough const [searchResults, setSearchResults] = useState([users]);
Hi @paulatorre Try to add setSearchResults(users) to the line 15
Hej @Deve1980 :) Do you mean in the UseEffect? (I was playing with use ref and adding some extra lines so now I'm lost with the order I had before) Thanks!
Hi @paulatorre Try to add setSearchResults(users) to the line 15
If you want to view users from first time you loading the page, add this line add setSearchResults(users) to the useEffect. and can change [searchResults,setSearchResults] = useState(users) to useState("")
yes, I want that! I didn't understand where to add what you suggested (setSearchResults(users)) because now my line 15 has a different code
in the useEffect that used to FOCUS ON SEARCH INPUT
Finally fixed by adding a "users" as a second dependency of the use effect that handles the filter
Finally fixed by adding a "users" as a second dependency of the use effect that handles the filter
Did you mean to close this request? @paulatorre
2 commits. One from Paula and one from Farooq. fixes#18