React useStateの「prev」「...prev」「[key]」の意味と使い方をやさしく解説
https://qiita.com/kazutorahattori/items/4575e1b6e41463e3dbf4?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items
React useStateの「prev」「...prev」「[key]」の意味と使い方をやさしく解説
https://qiita.com/kazutorahattori/items/4575e1b6e41463e3dbf4?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items
Как тестировать хуки в React с @testing-library/react-hooks
Привет, Хабр! Сегодня рассмотрим, как тестировать React‑хуки с помощью @testing-library/react-hooks .
https://habr.com/ru/companies/otus/articles/923214/
#react #React_Hooks #Тестирование_React #Юниттесты #Хуки #useState #useCallback
Попытка написать свою реализацию встроенных хуков состояния в React + создание простого стейт менеджера
Не так давно я смотрел ничем не примечательный ролик про техническое интервью и услышал фразу от интервьюируемого фразу: «Ну можно написать свой useReducer или useState» — и мне захотелось вдруг попробовать ибо я никогда в серьез не задумывался как они работают под капотом и принялся за дело.
https://habr.com/ru/articles/881668/
#react #usestate #usereducer #hook #store #state_management #typescript #javascript
Немного предыстории Не так давно я смотрел ничем не примечательный ролик про техническое интервью и услышал фразу от интервьюируемого фразу: "Ну можно написать свой useReducer или useState" - и мне...
Did you know there are multiple ways to set initial values in React's useState?💡
Check out my latest article to master this essential hook and discover techniques you probably didn’t know about!
【注意喚起】ReactのuseStateの値がすぐに更新されない理由を誤って理解しがちな件について
https://qiita.com/haruki-lo-shelon/items/38b5e5f7842892b4485f?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items
New Blog released on @hashnode
Topic: This is how I built a counter using React
Link: https://edsondsouza.hashnode.dev/counter-using-react-and-tailwindcss
@Hiteshdotcom
Theory Counter is a basic project built to understand the usage of Hooks in React. In this project a react hook called useState is used. UseState hook is nothing but a function. It returns an array with two elements: the current state value and a fu...
Heute erst kapiert, dass sich #reactjs state (zumindest in funktionalen Komponenten) in Closures wie Konstanten verhalten... also nicht den aktuellen Wert repräsentieren, wenn die Funktion dieses Closures ausgeführt wird.
Man lernt nie aus.
Workaround: Mit useRef() eine Referenz setzen und diese über useEffect[state] immer aktuell halten