Hey, Dave. I've found your channel through Free Code Camp and I really have to thank you because I've learned a lot through your channel especially on hard topics like recursions, Callbacks and closures. I really appreciate your time making these videos and I hope you could hear my request. I would like to request your time to make some content regarding JavaScript Unit Testing with Jest. There really isn't that much content and most content around it seems to be only focused on React but not on JavaScript itself. I hope you'll hear me out. Thanks.
Instead of doing `payload ?? ''`, what do you think about using explicit types for each action? Something like: type NewInputAction = { type: NEW_INPUT, payload: string, } type IncrementAction = { type: INCREMENT, } type ReducerAction = NewInputAction | IncrementAction const reducer = (state: ReducerState, action: ReducerAction) => { That way you can keep honest the actions coming in, and ensure that the proper payload is being provided for each action type. Also, I've used Redux but I actually haven't used useReducer before. It seems like it may be a good solution to handle form data with several fields? I wonder how to properly typescript that use case.
hey @Dave Gray,trying to understand the useReducer hook. but I am getting stuck at the type ChildrenType = {children : (num : number) => ReactNode}. is this a function? Why do we need it ?
Awesome video as always 👍 Typescript is awesome on the frontend. Recently I have been learning to implement it on the backend. But it doesn’t have that much support (especially with ORMs).
The link in the description goes to course resources. The starter code is the code from the previous chapter. I _think_ I said this in the video, but apologies if I did not.
Great tutorial. Is there any particular reason why you create the Reducer Action Types in all caps? Is it just for us viewers to understand it better and have a better visual representation? Or is it somewhat related to good coding practice?
It's more to do with coding practice. I do mainly C# and would type the enum out as normal PascalCase, yet other devs on the team prefer that horrible shouty capitals. I personally hate it as it detracts from the rest of the code on the page. I do see it in caps more by those that do javascript these days., but it's really up to you on which way you like, especially of you're solo and not in a team.
Hello sir, I am learning MERN stack using free youtube content. I am about to complete my front-end part and I was thinking after doing front-end I will start finding internship but there is one problem or opportunity I can say that my college has conducted a workshop so there is one company who is gonna give us internship for 6 moths on Node js. So my question is could please give me an advise that should i take this opportunity or after completing front-end I should apply for front-end?
Sounds like a great opportunity to gain some real experience! Also, Node.js is still JavaScript so you will continue to improve many skills that can translate back to frontend in the future. 💯
Great video, thanks. I'm getting use to react and the other hooks so trying to sink my teeth into the useReducer. I've been given a project a work which I'm taking over from some contract workers they have had, and it's a mess. then basically have one component and define 100's of useState and pass them down to each component, about 20 to each, depending on the area of the application. this reducer stuff would have made it look nicer and more manageable. Thanks for sharing this, it will be very useful.
One thing I don't understand: the general advice is use Context with a grain of salt, only if necessary, and don't abuse it. One the other hand, the general advice is use reducers instead of state, and of course, put them inside context. So, which is right? What is good practice here?
As you said, it is all general advice that you have read. I can't comment on their advice - whoever it is - but my general thoughts: 1) If your state is really simple, just useState. 2) Ok, your app is getting bigger - now a reducer and context might make sense.
@@DaveGrayTeachesCode Thanks for tip, Dave. I guess my confusion is, in the context (ha!) of a reducer, it is OK to use context. At least, that's the conclusion I'm able to draw.
Hey Dave. There is no starter code for this lesson, both in lesson 13, 14 and 15. You should probably structure you files as lesson 1 - starter and finished and so on. This is what I have seen most online and is less confusing to work with.
@@ubtonai.online7988 it is for React beginners, but you should learn HTML, CSS, and JavaScript before React. I have courses on my channel for all of these.
Hey, Dave. I've found your channel through Free Code Camp and I really have to thank you because I've learned a lot through your channel especially on hard topics like recursions, Callbacks and closures.
I really appreciate your time making these videos and I hope you could hear my request.
I would like to request your time to make some content regarding JavaScript Unit Testing with Jest. There really isn't that much content and most content around it seems to be only focused on React but not on JavaScript itself.
I hope you'll hear me out. Thanks.
Great request! And thank you!
🔥Congratulations on the 💯k Subs! 🙌 (Well deserved IMO)
Wishing everybody happy holidays 🎄
Thanks! You too!
thank u so much hope you have a great year 2023 and happy new year 🙂
Thank you! You too!
Instead of doing `payload ?? ''`, what do you think about using explicit types for each action? Something like:
type NewInputAction = {
type: NEW_INPUT,
payload: string,
}
type IncrementAction = {
type: INCREMENT,
}
type ReducerAction = NewInputAction | IncrementAction
const reducer = (state: ReducerState, action: ReducerAction) => {
That way you can keep honest the actions coming in, and ensure that the proper payload is being provided for each action type.
Also, I've used Redux but I actually haven't used useReducer before. It seems like it may be a good solution to handle form data with several fields? I wonder how to properly typescript that use case.
I can understand it clearly. Thank you Dave!
I really enjoyed this tutorial, thank you Dave, excellent content.
You always put great content 😮
Thanks! 💯
Can't wait to see what GEM💎 you'll have for us next.
Thank you!
hey @Dave Gray,trying to understand the useReducer hook. but I am getting stuck at the type ChildrenType = {children : (num : number) => ReactNode}. is this a function? Why do we need it ?
Hey Dave. Good job 👌. You're the best .
Thank you! 🚀
Awesome video as always 👍
Typescript is awesome on the frontend. Recently I have been learning to implement it on the backend. But it doesn’t have that much support (especially with ORMs).
Thank you!
Thanks Dave, Good Job as always :)
You're welcome!
Can’t wait for context, need that for my project
🚀🚀
very useful and clearly understandable . thanks 👍
Great content! Thank you, Dave!
You're welcome!
Thank you, Dave
Welcome!
i don't find starter code u have branch only with finished ?
The link in the description goes to course resources. The starter code is the code from the previous chapter. I _think_ I said this in the video, but apologies if I did not.
Great tutorial. Is there any particular reason why you create the Reducer Action Types in all caps? Is it just for us viewers to understand it better and have a better visual representation? Or is it somewhat related to good coding practice?
It's more to do with coding practice. I do mainly C# and would type the enum out as normal PascalCase, yet other devs on the team prefer that horrible shouty capitals. I personally hate it as it detracts from the rest of the code on the page. I do see it in caps more by those that do javascript these days., but it's really up to you on which way you like, especially of you're solo and not in a team.
hi, awesome video! btw what theme do you use for your vs code?? thank you
Thanks! Github theme
Hello do you know a y good tutorial or resources too help me with VS code it's really slowing me down
Yes, here is a link to the best VS Code course I know of: bit.ly/3SYKcwE
Gracias Dave
De nada 😀
Hello sir, I am learning MERN stack using free youtube content. I am about to complete my front-end part and I was thinking after doing front-end I will start finding internship but there is one problem or opportunity I can say that my college has conducted a workshop so there is one company who is gonna give us internship for 6 moths on Node js. So my question is could please give me an advise that should i take this opportunity or after completing front-end I should apply for front-end?
Sounds like a great opportunity to gain some real experience! Also, Node.js is still JavaScript so you will continue to improve many skills that can translate back to frontend in the future. 💯
@@DaveGrayTeachesCode Thank you sir, so I will take this opportunity. Thank you for teaching us.😇
Great video, thanks. I'm getting use to react and the other hooks so trying to sink my teeth into the useReducer. I've been given a project a work which I'm taking over from some contract workers they have had, and it's a mess. then basically have one component and define 100's of useState and pass them down to each component, about 20 to each, depending on the area of the application. this reducer stuff would have made it look nicer and more manageable. Thanks for sharing this, it will be very useful.
One thing I don't understand: the general advice is use Context with a grain of salt, only if necessary, and don't abuse it. One the other hand, the general advice is use reducers instead of state, and of course, put them inside context. So, which is right? What is good practice here?
As you said, it is all general advice that you have read. I can't comment on their advice - whoever it is - but my general thoughts: 1) If your state is really simple, just useState. 2) Ok, your app is getting bigger - now a reducer and context might make sense.
@@DaveGrayTeachesCode Thanks for tip, Dave. I guess my confusion is, in the context (ha!) of a reducer, it is OK to use context. At least, that's the conclusion I'm able to draw.
Hey Dave. There is no starter code for this lesson, both in lesson 13, 14 and 15. You should probably structure you files as lesson 1 - starter and finished and so on. This is what I have seen most online and is less confusing to work with.
Sometimes I do, but often I just provide the finished code. You can start a new project from scratch fairly easily.
thank you sir
Most welcome!
Can you please make basic to advanced level git and GitHub Tutorials!
Great request!
Dave! I couldn join you in discord cause I live in IRI and as you know maybe our Internet services is horrible.
I need your consultant tooo much,
Sorry to hear that! Ask questions on a video if you cannot join Discord, but sometimes RUclips hides comments and questions and I don't see them.
🚀🚀🚀🚀
🙏💯🚀
Please course React with javascript
React is JavaScript. If you look on my channel page you will find courses on React and JavaScript. 👀
@@DaveGrayTeachesCode i think your react course not for beginners. React zero to hero full course. Thanks. Your tech technology wonderful
@@ubtonai.online7988 it is for React beginners, but you should learn HTML, CSS, and JavaScript before React. I have courses on my channel for all of these.
@@DaveGrayTeachesCode Thank you
💓