context / custom usetodo hook
I've been spending a couple of days trying to understand context and the usetodo custom hook which was in the example code from the lessons, after running into a problem right at the start of the todo project which made me realise I need to use it. I (mostly) get it now which is good. But I was wondering, is it ok to put basically all of my functions and state for the project inside the todoprovider? so that way, every page and component inside app has access to all the different data, if need be. So all the different components will basically be return statements with all the necessary JSX and with various props, accessing functions and state from the context provider. It seems like it would bring some simplicity and I like the idea of it but not sure if it's a viable thing to do?
4
2 comments
Ryan Hazlewood
5
context / custom usetodo hook
Developer Pro
skool.com/developerpro
Learn how to code. Make money. Have fun. Enjoy life.
Leaderboard (30-day)
Powered by