React Routing, Props, and Inputs (P5D91) - Live Coding with Jesse
FBTwitterReddit
video description
Rating: 4.0; Vote: 1
Project 5 Day 91: Today we will add the ability for search from the app bar or side drawer inputs. We will need to navigate to the search page and automatically make an api call to search with the value from the input.
.
Next.js 5: https://zeit.co/blog/next5
Project Repo: https://github.com/fus-marcom/franciscan-react
React: https://facebook.github.io/react/
Gitter: https://gitter.im/LiveCodingwithJesseFreeCodeCamp/
Milos: You missed an important thing about setstate. Its asynchronous, so you didnt have access to updated state.searchTerm in the function below. You kinda fixed it with debounced function for fetching but its not the right solution. SetState provides optional 2nd argument for the callback function to be executed after the state is actually set. You should use it. Sorry if you updated it already, didnt have time to watch the whole video. Cheers - Date: 2022-03-14