React Patterns

React patterns that I find useful / worth checking out

  • Tags: Web Development
  • Last updated: 

Order of file

  1. State
  2. Derived State
  3. Hook Calls
  4. Functions
  5. JSX

React Form Pattern

from Cory House

  • Store as “touched”
    • touched - What fields have been touched
  • Stores as “status”
    • submitted - Has the form been submitted
    • isSubmitting - Is the form submission in progress
  • Derive the rest
    • isValid - Validate based on validated form values
    • errors - What are the errors for each field?
    • dirty - Has any field been touched?