You might not need useState()!

JavaScript / Web 38.3K צפיות 31/01/2024
פתח ב-YouTube

דרג סרטון זה

התחבר כדי לדרג

תיאור

The useState() Hooks is a crucial React Hook. But it's sometimes being used in situations where you actually don't need - and where you therefore shouldn't use it. Because there are UX or performance benefits to be reaped when avoiding it in certain scenarios. Learn all about React (discount applied): https://acad.link/reactjs 🖥️ Official Website & Courses https://academind.com/courses/ 💬 Academind Community https://academind.com/community 👋 Social Media https://twitter.com/maxedapps https://twitter.com/academind_real https://www.instagram.com/academind_real/ https://www.facebook.com/academindchannel/ https://www.linkedin.com/in/maximilian-schwarzmueller/ https://www.linkedin.com/in/manuel-lorenz-808b5185/ https://www.linkedin.com/company/academind-gmbh https://www.linkedin.com/school/academind-pro https://www.tiktok.com/@academind_real 00:00:00 - Introduction 00:00:33 - useState() Recap 00:01:27 - Using useRef() instead of useState() 00:03:12 - Alternative: Leveraging Built-in Browser Features 00:04:13 - React Deep Dive 00:04:57 - Alternatives: Store Information in URL (Query Params) 00:07:02 - Improvement: Sync State with localStorage 00:08:08 - Conclusion

#Academind