From 975b5aaa6d884611ef0c903877971e291bae7c4f Mon Sep 17 00:00:00 2001 From: byt3h3ad Date: Fri, 1 Mar 2024 12:13:19 +0530 Subject: [PATCH] new: react-hooks.md --- react/react-hooks.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 react/react-hooks.md diff --git a/react/react-hooks.md b/react/react-hooks.md new file mode 100644 index 0000000..8be8932 --- /dev/null +++ b/react/react-hooks.md @@ -0,0 +1,16 @@ +# React Hooks in a Nutshell + +- **useState:** Hold/update values + re-render. + +- **useRef:** Hold values, no re-render. + +- **useEffect:** Execute side effects after render. + +- **useReducer:** useState with reducers. + +- **useMemo:** Cache values between renders. + +- **useCallback:** Retain function identities. + +[source](https://x.com/_georgemoller/status/1763363283883487516) +