I would like if you could show us the result you expect at the beginning of each exercice (not the code, just the app). Sometimes I'm not sure of what we are supposed to do until I see the solution, and I realise I could have done it alone if I had known. Besides that, absolutely stellar content, the best react course I've seen online !
@@TechWithNader i did see it, but I was a bit confused when it comes to the choice of deno instead of Node (as it's a lot more popular). Will any of these skills transfer to regular Nodejs?
@@ruskasielu6261 Yup! I chose Deno because it uses all the standard Web APIs and they transfer to anything that uses them 😊 Also the main concepts apply to any style of rest like API 🥳
Thanks a lot @TechWithNader! Regarding Ex 2, I found a simpler solution which seems to work. Are there any problems with this approach? const [state, setState] = useState(initialState) function setStateWithLogging(newState) { let resultingState resultingState = typeof newState === "function" ? newState(state) : newState setState(resultingState) console.log("state has changed from " + state + " to " + resultingState) } return [state, setStateWithLogging]
Hello @TechWithNader , many thanks for the extremely helpful video. I got a question for you regarding Exercise 3 (useQuery custom hook): isn't it a React anti-pattern to fetch outside of a useEffect hook? I'm referring to the function fetcher you coded. Technically, the network request as you coded the hook is not placed inside a useEffect hook. Should this be a point of concern ? Thanks again.
Great question! You are correct that you should generally not fetch data outside a use effect (since it’s a side effect). In this case we still abide by that rule since inside the hook the fetch code is contained inside the use effect. It just looks like we are using it outside in the component we are using the hook in, but picture copying and pasting the hook code and you’ll see it’s still all contained in the effect and state calls as you’d expect 😊 Hope that makes sense!
Hats off to your consistency!!
Thanks Patrick!
I would like if you could show us the result you expect at the beginning of each exercice (not the code, just the app). Sometimes I'm not sure of what we are supposed to do until I see the solution, and I realise I could have done it alone if I had known.
Besides that, absolutely stellar content, the best react course I've seen online !
Thanks for the recommendation! I'll try to find a way to incorporate this in future videos 😃
@@TechWithNader great to hear ! Also are you planning to do other JS-related courses like Express or typescript at some point?
@@ruskasielu6261 I have the REST API course in progress right now using Deno (TS/JS) 🦕
@@TechWithNader i did see it, but I was a bit confused when it comes to the choice of deno instead of Node (as it's a lot more popular). Will any of these skills transfer to regular Nodejs?
@@ruskasielu6261 Yup! I chose Deno because it uses all the standard Web APIs and they transfer to anything that uses them 😊 Also the main concepts apply to any style of rest like API 🥳
Thanks a lot @TechWithNader!
Regarding Ex 2, I found a simpler solution which seems to work. Are there any problems with this approach?
const [state, setState] = useState(initialState)
function setStateWithLogging(newState) {
let resultingState
resultingState = typeof newState === "function" ? newState(state) : newState
setState(resultingState)
console.log("state has changed from " + state + " to " + resultingState)
}
return [state, setStateWithLogging]
nice job 👊🏿
Hello @TechWithNader , many thanks for the extremely helpful video.
I got a question for you regarding Exercise 3 (useQuery custom hook): isn't it a React anti-pattern to fetch outside of a useEffect hook? I'm referring to the function fetcher you coded. Technically, the network request as you coded the hook is not placed inside a useEffect hook. Should this be a point of concern ?
Thanks again.
Great question! You are correct that you should generally not fetch data outside a use effect (since it’s a side effect). In this case we still abide by that rule since inside the hook the fetch code is contained inside the use effect. It just looks like we are using it outside in the component we are using the hook in, but picture copying and pasting the hook code and you’ll see it’s still all contained in the effect and state calls as you’d expect 😊
Hope that makes sense!
Fire 🔥
'Promosm' 🎉