Frontend Development Lead
Hello, there 👋 I'm Alan! I love teaching people how to code, and making coding tutorials, one of my big passions is transferring my web development/coding skills and knowledge on to people like you! 🔥 ...I'm a 29-year-old Software Developer based in Belfast in Northern Ireland. My current full-time role is Frontend Development Lead where I lead and oversee all the frontend development for our new platform and framework, built in NextJS, React TailwindCSS bundled in a NX mono-repo. I am also the Mobile Team Lead where I develop apps for our company using the Ionic Framework and React javascript. Throughout this blog, expect to see How to posts about coding on all aspects of HTML, CSS, Javascript (JS), ReactJS, NodeJS, PHP, and even the odd review of cool UI Frameworks or libraries that I've found. 🔔 Be sure to subscribe to my YouTube channel if you want to catch my quick, easy to follow coding tutorials! 🔔
Markdown supported · ⌘↵ to post
The issue I found using React Context API is that the number of nested components increase as your props increase.
People should determine at first hand how complex their project would be to decide using React Context API or a state management library like Redux.
Isaac Way
This is well written but it feels like it's half of a tutorial. The above implementation is completely unusable because the value of the context is going to be reset any time the user. I'm sorry but I'm just so frustrated. Every. Single. Tutorial about Contexts and NextJS is like this. I keep searching and searching for an example of actually using these things but all I get is articles like this one, where you're just using the context as a place to store data for a single page.
Contexts are useful because they allow components and pages to share state, right? Well then, what is the point of using one if your state is just going to be reset whenever you redirect? What is the point of having login data that disappears when you change pages? Am I missing something here? I do not understand how the above example is useful in any way if the context is just reset to the default value every time you redirect to a new page.
Edit: Yeah I was missing something. Sorry lol. I just needed to use <Link> to redirect instead of vanilla <a> tag. Maybe include that in the article for future dummies?