Can you tell me the differences between useState and useMemo?
Anonymous
useState is used to manage state in a functional component. It lets you store and update values that should trigger a re-render when they change. For example, toggling a modal or tracking user input. useMemo is used for performance optimization. It memoizes the result of a computation and only recalculates it when its dependencies change. This is useful when you have expensive calculations or want to avoid unnecessary re-renders of child components.
Check out your Company Bowl for anonymous work chats.