1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Build Your Own Formik Using React Hooks with Jared Palmer

    reactReact

    Jared Palmer is the creator and maintainer of Formik, the premiere forms solution for React applications. Formik makes forms in React easy by managing your form's state and providing validation on all of your fields. Under the hood, Formik is using React Hooks, and today we are going to make our own mini Formik with them!

    useReducer is the hook to use for any complex state management. useReducer follows the redux principle of returning a modified copy of the state. Writing a custom hook with useReducer lets you decouple your handlers and state from the component into a testable function.

    • The useEffect hook isn't the same as the componentDid... lifecycle hooks. It runs on each render, and you can pass an array that tells it to not run if the value hasn't changed from the previous render.

    • onBlur should be used over onMouseDown so that errors aren't shown before the user types

    • useHooks.com

    • Formik Overview