How to Save React State to Local Storage (with Context API)

  Рет қаралды 7,808

Nikita Dev

Nikita Dev

Күн бұрын

In this video you'll learn how to save your react app state to local storage so that relevant data will be persisted.
Codesandbox: codesandbox.io/p/sandbox/reac...
Context API Explanation: • React Context API Tuto...
Github: github.com/nikitapryymak
Support Me: www.buymeacoffee.com/nikitadev
Contact Me: nikitadev292@gmail.com

Пікірлер: 15
@SILLY_BILLY_777
@SILLY_BILLY_777 11 күн бұрын
DUDE I'VE BEEN TRYING TO SOLVE THIS PROBLEM FOR LIKE A WEEK THANK YOU SO MUCH
@aleksey6151
@aleksey6151 Жыл бұрын
Very helpful and easy to implement, thanks!
@muhammadamjad4046
@muhammadamjad4046 Жыл бұрын
Very helpful and easy to understand video. Explained nicely what I needed exactly.
@tiendung9508
@tiendung9508 Жыл бұрын
Easy to understand, thank a lot brother ❤
@EzekielOladele-ok2do
@EzekielOladele-ok2do Жыл бұрын
Thanks so much. You're a great teacher!!!!
@ekinsuaydn7933
@ekinsuaydn7933 Жыл бұрын
It's a very helpful video!! Thank you
@korveld
@korveld Ай бұрын
Very helpfull tip, thanks!
@bun_bun17
@bun_bun17 9 ай бұрын
you are god sent
@shaileeeliyahu9600
@shaileeeliyahu9600 13 күн бұрын
Thanks for the useful tutorial! HOWEVER - Please note that useEffect should NOT be used as a listener, or as a way to activate side-effects (yes, even despite the confusing name). This is bad practice because it soon brings to circular/hard-to-manages dependency chains, with no real way to track which change leads to another. In this case, you should have wrapped to triggered function - instead of calling the "setTeam" function, you should have called either: 1.something like "setTeamAndSaveToLocalStorage", which gets a new state value, and sets the local storage to it, and right after that the team state. 2.a generic "setStateAndSaveToLocalStorage" function, which gets a setState func as a parameter, as well as a key for localStorage, and does the same thing, while just being reusable. In general - useEffect should be used as a tap to the mount/willUnmount events of a component. Everything else should be handled by triggers (onClick, onChange, etc...), to avoid listeners which are practically unmaintainable.
@vinayakhegde4216
@vinayakhegde4216 Жыл бұрын
Hey man i saw your AWS s3 tutorial . I have doubt wether or not i can use multer to upload video files and is their any size limitation if i want to upload video ? My project is smiliar to other ott platforms but mainly it focus on regional and shortflims so is it possible to stream full video's using AWS s3 (with free tier) and also thank you for the formik and module videos i understood those concept well :)
@MidhunrajR-im6wu
@MidhunrajR-im6wu 2 ай бұрын
Why don't you put more number of videos? Your videos are really useful.
@maskedvillainai
@maskedvillainai 7 ай бұрын
AnimatePresence supports calling unmounted prototypes and can be used with any react component. Way easier, one line of code.
@gregthomas5887
@gregthomas5887 Жыл бұрын
Great explanation! Curious: Are there any production-level apps that still make use of localstorage?
@nikita-dev
@nikita-dev Жыл бұрын
yes for sure
@gregthomas5887
@gregthomas5887 Жыл бұрын
@@nikita-dev I've heard from a few other devs that localstorage has a lot of security concerns which is why we rarely see it being used in prod. What kind of services or apps still use it?
React Context API Tutorial (with useContext) | React Hooks
13:01
Nikita Dev
Рет қаралды 4,3 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 487 М.
تجربة أغرب توصيلة شحن ضد القطع تماما
00:56
صدام العزي
Рет қаралды 58 МЛН
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 14 МЛН
Кастомные React-Хуки, useToggle, useLocalStorage
22:20
Михаил Непомнящий
Рет қаралды 19 М.
JavaScript Cookies vs Local Storage vs Session Storage
14:28
Web Dev Simplified
Рет қаралды 736 М.
14 Context API with local Storage
1:08:19
Hitesh Choudhary
Рет қаралды 12 М.
Error Handling in NodeJS (Complete Guide) | Node Tutorial
17:54
Nikita Dev
Рет қаралды 40 М.
You might not need useEffect() ...
21:45
Academind
Рет қаралды 154 М.
Mastering React Context: Do you NEED a state manager?
37:26
Jack Herrington
Рет қаралды 97 М.
React Formik Tutorial with Yup (React Form Validation)
34:50
Nikita Dev
Рет қаралды 108 М.
Учим React  LocalStorage / #3 - React JS для начинающих
12:09
Илья Стоянов - Верстка Сайта
Рет қаралды 3,7 М.
Context API in react | get the concept
29:00
Hitesh Choudhary
Рет қаралды 47 М.
React Hooks Crash Course (useMemo, useCallback and more).
31:49
developedbyed
Рет қаралды 82 М.
Как бесплатно замутить iphone 15 pro max
0:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 1,6 МЛН
Как удвоить напряжение? #электроника #умножитель
1:00
Hi Dev! – Электроника
Рет қаралды 939 М.
Красиво, но телефон жаль
0:32
Бесполезные Новости
Рет қаралды 1,4 МЛН
Kumanda İle Bilgisayarı Yönetmek #shorts
0:29
Osman Kabadayı
Рет қаралды 555 М.
ГОСЗАКУПОЧНЫЙ ПК за 10 тысяч рублей
36:28
Ремонтяш
Рет қаралды 540 М.