- Видео 89
- Просмотров 134 235
Austin Davis
США
Добавлен 22 июл 2022
Welcome to the channel! My name is Austin, and I just make simple tutorials to help beginners get into the field of programming. With a relatively steep learning curve, many people are turned away from programming due to the difficult-to-follow tutorials that don't adequately cater to beginners. On this channel we focus on making things understandable and easy to follow, so that you can learn programming and programming concepts in the simplest possible way. Hope you enjoy the channel!
State Management in React Will Never Be the Same
Looking for a better way to manage global state in your React apps? In this video, we explore an innovative React state management library that simplifies your workflow while maximizing efficiency. Discover how atomic state works, why it's a game-changer for developers, and how you can implement it in your projects with ease. Whether you're building small-scale apps or large enterprise apps, this tool will revolutionize the way you handle state.
The tool/library in question is Jotai. In this video, you'll learn what Jotai & atomic state is, how to get it into your app, how to create and access atoms, and how to scope atoms to create instances that are non-global.
Jotai Docs: jotai.org/doc...
The tool/library in question is Jotai. In this video, you'll learn what Jotai & atomic state is, how to get it into your app, how to create and access atoms, and how to scope atoms to create instances that are non-global.
Jotai Docs: jotai.org/doc...
Просмотров: 18 343
Видео
Learn TypeScript with React in 2024 - Full Beginner Tutorial
Просмотров 1,1 тыс.3 месяца назад
Learn TypeScript with React in 2024 - This complete tutorial walks you through everything you need to know to get started with TypeScript in a React project. Whether you're new to TypeScript or looking to integrate it into your React applications, this video covers the essentials for both beginners and experienced developers. In this step-by-step guide, you’ll learn how to set up TypeScript in ...
STOP Using Redux! Do This Instead
Просмотров 1,4 тыс.3 месяца назад
In this video, I'll explain why you don't always need Redux for state management in React, especially for simpler applications. I'll show you how to use useContext to solve a similar problem Redux does, but with far less complexity and setup. We'll walk through a coding example where I implement useContext in place of Redux, and I'll explain when it's appropriate to use each one. Whether you're...
React Google Login: Easy Authentication Tutorial
Просмотров 2,2 тыс.4 месяца назад
Learn how to implement Google login in your React app using the react-oauth library (shoutout to @MomenSherif on GitHub!) and Google Identity Services SDK. This step-by-step tutorial will guide you through the process of setting up Google authentication, ensuring your users can sign in securely and effortlessly. Perfect for beginners and experienced developers alike, this video covers setup and...
Build a Wordle Clone in React: Full Code-Along Tutorial
Просмотров 2244 месяца назад
In this video, we'll build a fully functional Wordle clone using React from scratch! This code-along video is perfect for developers looking to enhance their skills with practical, hands-on experience. We'll walk through every step of the process, from setting up the React environment to implementing game logic, managing state, and styling the app with Tailwind CSS. This is a new style of video...
Learn TailwindCSS in 113 Seconds
Просмотров 1274 месяца назад
Learn TailwindCSS in less than 2 minutes with this rapid tutorial! Tailwind is a modern CSS framework that allows you to write inline CSS very easily, with plenty of premade utility classes available on Tailwind's website. After watching this video you'll be a certified Tailwind expert! (okay maybe not) 📢Join my brand new Discord community! discord.gg/QJ4mYGjUcN 📚Resources: Tailwind Docs: tailw...
Build a React Weather App from Scratch - Full Tutorial (2024)
Просмотров 6344 месяца назад
Welcome to this full React tutorial where you'll learn how to build a weather app from scratch! Whether you're a beginner or looking to enhance your skills, this video walks you through every step of creating a responsive, real-time weather application using React JS. If you're looking to master React and build a project that impresses, this is the tutorial for you! By the end of this video, yo...
How to Create Responsive Websites (TailwindCSS)
Просмотров 4,1 тыс.4 месяца назад
Welcome to the comprehensive guide on How to Create Responsive Websites using TailwindCSS! In this video, I'll take you through the step-by-step process of building a fully responsive website with TailwindCSS, one of the most popular CSS frameworks in web development. In this video, you'll learn how responsive design works in Tailwind, how to apply responsive design prefixes to any styling attr...
MERN Stack Tutorial: Learn MongoDB, Express, React, Node.js
Просмотров 13 тыс.5 месяцев назад
🔴 MERN Stack Tutorial for Beginners: Full Course (MongoDB, Express, React, Node.js) 🔴 Welcome to the ultimate MERN Stack tutorial! This comprehensive 6-hour course is designed for beginners and will guide you step-by-step through building full-stack web applications using MongoDB, Express, React, and Node.js. Whether you're new to programming or looking to expand your web development skills, th...
MERN Tutorial: Ep 12 - Styling
Просмотров 2425 месяцев назад
Welcome back to our MERN Full Stack Web Dev course! In this episode, we’ll take care of the styling aspect of our site. We'll use shadcn and Tailwind to make our site look much prettier than the default. Styling your site to look professional may take hours, but in this video we'll just cover the basics necessary for you to get started! Steps Covered: How to add shadcn to your project How to ad...
MERN Tutorial: Ep 11 - Media Management
Просмотров 2865 месяцев назад
Welcome back to our MERN Full Stack Web Dev course! In this episode, we’ll explore the concept of media management, which, in our context, means being able to upload not only text to a database, but images and possibly video/audio in the future if you'd like. Steps Covered: How to create a bucket in AWS S3 How to write backend (Express) routes for AWS S3 How to get valid AWS Credentials How to ...
MERN Tutorial: Ep 10 - Authentication 2/2
Просмотров 2495 месяцев назад
Welcome back to our MERN Full Stack Web Dev course! In this episode, we’ll explore the concept of authorization and authentication, which refers to creating user profiles, and ensuring they have the appropriate permissions to interact with our site, as well as ensuring users without permissions cannot do things they are not permitted to. Steps Covered: How to send authentication token through A...
MERN Tutorial: Ep 9 - Authentication 1/2
Просмотров 4065 месяцев назад
Welcome back to our MERN Full Stack Web Dev course! In this episode, we’ll explore the concept of authorization and authentication, which refers to creating user profiles, and ensuring they have the appropriate permissions to interact with our site, as well as ensuring users without permissions cannot do things they are not permitted to. Steps Covered: How to create a Mongo collection How to cr...
MERN Tutorial: Ep 8 - React Pages 3/3
Просмотров 2165 месяцев назад
Welcome back to our MERN Full Stack Web Dev course! In this episode, we’ll start building out our frontend pages using React. This episode, along with Episodes 6 and 7, will be the three episodes dedicated entirely to React. Steps Covered: How to create frontend routes How to create React pages How to upload Mongo items in React Key Topics: Full Stack Development Frontend development Express Ro...
MERN Tutorial: Ep 7 - React Pages 2/3
Просмотров 2515 месяцев назад
Welcome back to our MERN Full Stack Web Dev course! In this episode, we’ll start building out our frontend pages using React. This episode, along with Episodes 6 and 8, will be the three episodes dedicated entirely to React. Steps Covered: How to create React pages How to render in data from the backend in React How to map over an array of data objects How to view data from one Mongo post in Re...
MERN Tutorial: Ep 6 - React Pages 1/3
Просмотров 2575 месяцев назад
MERN Tutorial: Ep 6 - React Pages 1/3
MERN Tutorial: Ep 5 - Frontend Connection
Просмотров 7095 месяцев назад
MERN Tutorial: Ep 5 - Frontend Connection
MERN Tutorial: Ep 4 - Backend Routes
Просмотров 7495 месяцев назад
MERN Tutorial: Ep 4 - Backend Routes
MERN Tutorial: Ep 3 - Setting Up Express
Просмотров 6135 месяцев назад
MERN Tutorial: Ep 3 - Setting Up Express
MERN Tutorial: Ep 2 - MongoDB & Node Setup with Vite
Просмотров 1,3 тыс.5 месяцев назад
MERN Tutorial: Ep 2 - MongoDB & Node Setup with Vite
MERN Tutorial: Ep 1 - Course Overview & Intro
Просмотров 1,4 тыс.5 месяцев назад
MERN Tutorial: Ep 1 - Course Overview & Intro
Redux with React - Full Tutorial (2023)
Просмотров 4 тыс.Год назад
Redux with React - Full Tutorial (2023)
React - Nested Components Tutorial (Childen props)
Просмотров 11 тыс.Год назад
React - Nested Components Tutorial (Childen props)
React JS Full Course 2023 - Learn From Scratch
Просмотров 3 тыс.Год назад
React JS Full Course 2023 - Learn From Scratch
React JS Tutorial - #8 - Example Project
Просмотров 2,5 тыс.Год назад
React JS Tutorial - #8 - Example Project
React JS Tutorial - #7 - Multiple Pages
Просмотров 13 тыс.Год назад
React JS Tutorial - #7 - Multiple Pages
React JS Tutorial - #6 - Lists & Conditionals
Просмотров 693Год назад
React JS Tutorial - #6 - Lists & Conditionals
how to do this in react native
nice
love and respect from Pakistan sir 🇵🇰 💛
Thanks for enlighting me about this awesome library. It was a great video. I would want more indepth video about jotai with complex state like non-primitives and other feature provided by Jotai with real world example. Also if possible would you please share Jotai optimized version so that there is no un-necessary re-render like Jotai's focusAtom or selectAtom.
how about delete and the other ?
nope i just knew it. you'd just fill those parameters
great video bro! thank you
deserves 100k views at least
You are my Hero man
Dislike. This video is about Toolkit. Not original Redux!
its good practice to clean up after the useEffect is finished , such as useEffect(() => { const controller = new AbortController() // Create an AbortController const signal = controller.signal async function getPosts() { try { const response = await axios.get("localhost:3000/posts", { signal }) console.log("response", response) if (response.status === 200) { setData(response.data) toast.success('Data fetched successfully!', { position: "top-right", }) } } catch (error) { if (axios.isCancel(error)) { console.log("Request canceled:", error.message) } else { console.error("Error fetching data:", error) } toast.error('Error fetching data!', { position: "top-right", }) } } getPosts() // Cleanup function to cancel the request return () => { controller.abort() } }, []) // Remove `data` from the dependency array to avoid infinite loops
just throws errors more react trash
Finally, a tutorial that goes straight to the point and doesn't make you install unnecessary packages. Great video!
Isthuthiii sahodaraya <3
I was aware of the Outlet component but this approach isn't intuitive. Thanks, Austin!
How should I go about incorporating my domain name instead of the localhost? Do I just place it where localhost is 7:03 ?
bro... thankyou for this series of videos
Thank you. Sir, will you do a custom google login button tutorial in the future?
great and comprehensive
Thank you
This is awesome. It makes me want to remove my context providers. Great video, subscribed!
contextApi killer?
Thank uuuuuuuuuuuuuuuuuu bro! I really appreciate it.
yaah nice one bro
Jotai is same creator/maintainer (dai-shi) as zustand which you mention. He has writeups that help explain which library to use depending on requirements.
nice
I would argue that putting state in the url (via search params) is my perferred way. That means you can mount your components everywhere and they will be context aware by default.
Thank you very much..... You explained very well 👍👍
Jotai is bigger than Zustand
Recoil actually does exactly this, how is this better than Recoil, Recoil actually has more features like getters, setters, family, effects etc.
=== Austin Davis Keeps deleting the Comment and Replies so I am reposting here because he is censoring free speech because I have ideas he doesn't agree with @Nellak2011 2 days ago Congrats. You now made your app infinitely harder to test and debug. Global State is a problem. In fact, it was such a big problem a whole programming paradigm was created to address it. @AustinDavisTech 4 hours ago I strongly disagree. Jotai is not a replacement for using normal React state. As long as you're not spamming atoms everywhere and you're using global state responsibly, it is 100% a better alternative than dodging global state entirely and prop drilling to infinity and beyond. There's a reason React itself supports global state with contexts and so many global state libraries have popped up. Web dev can get really complex, and without some sort of state management like Jotai, Zustand, or even contexts it becomes an absolute nightmare to navigate (Deleted Comment that was basically saying that Jotai is unregulated global state and is bad, I can no longer find the comment anymore) @Nellak2011 Look the problem is simple. Let me simplify so you can understand. 1. It is unregulated global state 2. It is not isolated So no matter what argument you have, it fails this fundamental test. Why is it unregulated? -> No one knows what updated what Why is unregulation bad? -> Because you cant debug it easily Why is it not isolated? -> Because it introduces non local coupling. Your components are not a function if the props but of some hidden state elsewhere. Why is lack of isolation bad? -> It makes things harder to test and harder to reason about. Instead of being able to think about it in isolation, you have to consider the whole app. How do you do isolation and global state management? -> You explicitly pass your dependencies as props in 1 direction. Never do 2 way prop-drilling. For example, you have your state in your store, you pass the selectors used by the component explicitly down. But we can directly access the store with a hook, it is more complicated to pass down props explicitly. Why do you advocate that? -> Sure, we can shoot ourselves in the foot if we want, but it doesnt mean it is good to do so. The reason we pass the selected state from the store explicitly is so we can achieve isolation and so we become agnostic to the state provider. If we access it directly, we make a coupling to that specific store. In other words we make an implicit dependency and so to test the component we need to now mock the whole redux store instead of just passing in props. It is literally the bananna and jungle problem. ==> Therefore we should avoid unregulated global state like in context api or jotai. It leads to well known anti-patterns and is anti-thetical to good software engineering practices.
Austin Davis deletes comments he doesn't like just so you all know.
So if you want to use the global state you need to always import the original atom() to the component
It’s simple but it could get difficult to handle if you have many levers
This is wicked, somehow very similar to zustand but yet seems even simpler indeed. Would be nice to see how types work on typescript and how more complex state works too, for instance if you have several variables and a few set/get functions like the usual zustand drill.
made by the same guys lol
Jotai seems very easy to use, with not much of a setup. But having a bunch of global states worries me for the performance. Personally, I like useImmer and useImmerReducer. I don't mind setting up the reducer function once, and Immer helps with the immutability problem that native reducer had.
God this is beautiful.
State managers based on atoms are good only on examples or when they are simple. But having many atoms, on medium or large projects, can make the state management code realy messy. Especially when you read code after a few months xD
Congrats. You now made your app infinitely harder to test and debug. Global State is a problem. In fact, it was such a big problem a whole programming paradigm was created to address it.
Exactly, that's what my biggest concern was
I strongly disagree. Jotai is not a replacement for using normal React state. As long as you're not spamming atoms everywhere and you're using global state responsibly, it is 100% a better alternative than dodging global state entirely and prop drilling to infinity and beyond. There's a reason React itself supports global state with contexts and so many global state libraries have popped up. Web dev can get really complex, and without some sort of state management like Jotai, Zustand, or even contexts it becomes an absolute nightmare to navigate
@AustinDavisTech Contexts are semantically identical to Jotai. The fundamental problem here is that it is unregulated and not isolated. If a component changes state somewhere you can't know what it is without traceability like Redux offers with reducers. Moreover, since you have global state you have to recreate the entire DOM to test one compoment. No matter how you spin this, it is unregulated Global state which is an Anti-Pattern. I realize wish Front End influencers would study software Engineering Principles instead of hyping up Anti-Patterns.
Okay now you're just making stuff up 😂. Just because atoms effectively function as a global useState with context does not mean the entire app is a dependency of every single atom and the entire DOM re-renders for every single atom. If you make for instance ten layers of nested components and use an atom for layers 3 and 7, rather than prop drilling, the entire app (layers 0-10) does not all re-render. This claim is objectively false. Components only become dependencies of an atom if they subscribe to it, exactly how contexts work. Please go and test for yourself and you'll see exactly what I mean. I'm not sure where you got this information from? The only correct statement in here is that it is not isolated, which is the whole point. Complete isolation in a React app is not possible if you're building anything harder than a to-do list. Even if you're prop drilling, you're still making components become dependent on one another. Jotai, along with many other state management libraries, simply offers a better way to do it. Again, there's a reason why these libraries exist and React itself has built-in support for state sharing. Frontend developers aren't dumb or bad for doing this, in fact the most functional React apps are almost ALL going to have some sort of state management system in place. Just like literally everything else in programming, global state can be bad if it's abused. Memory management in C can be abused, but it'd be ridiculous for me to claim that nobody should touch memory in C because it's dangerous. I understand where you're coming from but some of your claims are objectively false, and applying a blanket statement like "global = bad" doesn't address the genuine need for state management systems in React apps.
@AustinDavisTech Look the problem is simple. Let me simplify so you can understand. 1. It is unregulated global state 2. It is not isolated So no matter what argument you have, it fails this fundamental test. Why is it unregulated? -> No one knows what updated what Why is unregulation bad? -> Because you cant debug it easily Why is it not isolated? -> Because it introduces non local coupling. Your components are not a function if the props but of some hidden state elsewhere. Why is lack of isolation bad? -> It makes things harder to test and harder to reason about. Instead of being able to think about it in isolation, you have to consider the whole app. How do you do isolation and global state management? -> You explicitly pass your dependencies as props in 1 direction. Never do 2 way prop-drilling. For example, you have your state in your store, you pass the selectors used by the component explicitly down. But we can directly access the store with a hook, it is more complicated to pass down props explicitly. Why do you advocate that? -> Sure, we can shoot ourselves in the foot if we want, but it doesnt mean it is good to do so. The reason we pass the selected state from the store explicitly is so we can achieve isolation and so we become agnostic to the state provider. If we access it directly, we make a coupling to that specific store. In other words we make an implicit dependency and so to test the component we need to now mock the whole redux store instead of just passing in props. It is literally the bananna and jungle problem. ==> Therefore we should avoid unregulated global state like in context api or jotai. It leads to well known anti-patterns and is anti-thetical to good software engineering practices.
React devs have forgotten the best state management library of them all, the U R L. I love this library, however I only use it in cases where I don't want to expose state to the user like setting a navbar's sticky state. Everything else goes into the URL bar in our projects.
I do think storing state in the URL is something people completely forget about and don't utilize as much as they could. However, some might say that even with a routing library, the URL still exists outside of the React ecosystem/lifecycle since it's part of the browser, making it less pure React, as opposed to something like Jotai that is 100% tied to the React DOM. This definitely can have upsides though depending how you look at it. Ultimately I think it is best to choose what works best for you :)
Isn't this just signals with extra steps?
not really, Jotai and signals are very similar in a lot of ways, but ultimately behave differently behind the scenes
This is same as recoil
This is what i searched fr
😂
I usually use useContext providers. Ill probably try this on my next project.
Lots of comments suggesting Jotai doesn't scale. I think folks are confusing a minimal API surface with lack of scalability. Jotai is extremely powerful, especially when you compose atoms together with custom setter functions. It is also one of the more performant state management solutions. Given its flexibility and performance, it can scale to accommodate very complex UI needs. However, it will be important to establish consistent patterns since the library itself is unopinionated. Personally, I have been shipping Jotai at a very large tech company in a product with many Fortune 100 customers. We use it in addition to TanStack Query for managing async/server state (most of our state needs), as well as a custom, type-safe URLSearchParams wrapper around React Router 6. Because the majority of our state management is handled by Query and searchparams, the unopinionated Jotai API is perfect for filling in the gaps when we have (rare) global, non-url, non-async/server state management needs. Thanks for giving Jotai the love it deserves!
Very helpful tutorial, thank you 🙌🏾
I think preact signals makes it much more simpler than this. This is a nice state management library tough...
Preact signals is much better and less bloated.
Not knocking signals at all but this is a gross oversimplification. Jotai is not bloated in the slightest AND is more "react-y" than signals are. Signals are cool and may have their place, but this kind of comparison doesn't do it justice
Can you show us your code? I wanna learn it more detail especially the code inside <Card/> component
nah, valtio is better. no boilerplate like this
Is the boilerplate in the room with us?
@@AustinDavisTech 😹😹