Jenny Truong & David Khourshid - useWat² - React Miami 2024

Discover best practices for building React applications, mastering hooks, context and avoiding common pitfalls.

Key takeaways
  • Vite is a usable alternative to React’s built-in development server, without the need for a framework.
  • React is a library, not a framework, and its documentation often hides this fact.
  • Higher-Order Components (HOCs) are not recommended for use due to limitations and strange behaviors.
  • React hooks, especially useEffect, can be tricky to use and require careful management.
  • The new useSyncExternalStore hook is a good alternative to useReducer for managing global state.
  • It’s okay to use JavaScript as a state management system, especially for simple updates.
  • The React community is not fully aware of the library’s nature and often treats it like a framework.
  • Vercel is a meta framework that sits on top of React, but React is not a framework itself.
  • React is not the only library that can be used for building user interfaces.
  • useContext is a good hook for managing states that rarely change, while useReducer is better for complex state management.
  • Using useReducer with a simple toggle can be a good alternative to class components.
  • useState is a great hook for managing state, but it’s not always the best choice.
  • React’s documentation is often outdated and can be confusing for beginners.
  • The best way to manage state in React is to use a combination of hooks and context, rather than relying on a single hook or framework.
  • Vite can be used as a fast development tool for building React applications.