Introduction
- React in 100 Seconds โข Fireship ๐บ
- Learn React for free โข Four-hour online course by Bob Ziroll and Scrimba that includes interactive coding challenges and exercises and culminates in building two apps ๐
- Mental Model of React Application Development โข 8 minute video by Basarat Ali explaining how JSX and the virtual DOM work under the hood ๐บ
- react.gg โข The interactive way to master modern React ๐
- A Chain Reaction โ overreacted โข Dan creates JSX in front of us โข Dan Abramov ๐
Composing Components
- Prefer Multiple Compositions โข Prefer a few major conditional rendering swaps over lots of minor inline ones โข Kyle Shevlin ๐
Server Components
- Making Sense of React Server Components โข Josh Comeau ๐
State Management
- when to use useState?
- when to use useReducer?
- when to use a state machine?
- when to use Context?
- when to use another library?
- TanStack Query
- Recoil
- Redux Toolkit
- etc
- ๐บ What State Management Library Should I Use with React? โข 9 minute video by Lee Robinson explaining good options for separately managing UI state (e.g.
xstate
) and server-caching state (e.g.react-query
,swr
). See the accompanying blog post for a table with specific solutions for various use cases - ๐บ How I Manage State in React โข 17 minute video by Leigh Halliday with tips for how to separately manage app state and external data in
react
- ๐บ Introduction to React Recoil (Experimental) State Management โข 28 minute video by Leigh Halliday using a shopping cart as an example to show how to use
recoil
to manage state - How to use React Context effectively โข Kent C. Dodds ๐
- How to optimize your context value โข Kent C. Dodds ๐
- Passing Data Deeply with Context โข React docs ๐
- zustand โข Bare necessities for state management in React ๐ ๏ธ
Testing React components & hooks
- Testing components that use React Router v6:
- javascript - How I could test location with MemoryRouter on React Router DOM v6? - Stack Overflow
- how to test React Router DOM v6 using
createMemoryRouter
andRouterProvider
- Testing hooks that use React Router v6:
- Complete Guide to React Hooks Testing | Toptalยฎ
- Excellent article that got me out of a bind writing tests for a hook that reacts to changes triggered by React Router v6
- Testing required rendering a hook (
useQueryParams
) inside of aRouterProvider
and then using that router to navigate during the tests - Using
@testing-libary/react-hooks
, itโs possible to passRouterProvider
as a hook wrapper, but not possible to get back a reference to the router to use forrouter.navigate()
. So, anynavigate()
calls are happening on a different router than the one wrapping the hook. - This article slowly builds up to
@testing-library/react-hooks
by showing you how you could write your ownrenderHook
function that returns anything you want - I followed that pattern and wrote a custom
renderHookWithRouter
function that returnsrouter
along with the rendered hook
- Complete Guide to React Hooks Testing | Toptalยฎ
Side Effects
SVG components
- ๐บ SVG Components in React โข 5 minute video by Basarat Ali showing how to create SVG components both manually and using
svgr
React Query
- ๐บ All About React Query โข 89 minute video by Tanner Linsley and Jason Lengstorf demonstrating how to use
react-query
to make cached fetch and post requests and keep them updated. Optimistic update method shown at 1:08:5 - ๐บ React Query v3 - Refactor an app into using React-Query โข 25 minute video by Weibenfalk showing how to refactor a movie search app infinite scrolling from custom data fetching hooks to
react-query
. - ๐บ React shopping cart with TypeScript โข 68 minute video by Weibenfalk showing how to create an ecommerce store using
react-query
3 and the Fake Store API - ๐บ React Query - Data Fetching Hooks โข 18 minute video by Leigh Halliday introducing how to use
react-query
to fetch data - ๐บ Posting Data to Server from React - Query Updates from Mutations โข 22 minute video by Leigh Halliday showing how to use
react-query
to update server-side data with an optimistic UI pattern
SWR
- ๐บ Buffering new Tweets with SWR โข 17 minute video by Sam Selikoff using a Twitter clone to demonstrate how to use
swr
to show cached content while fetching the latest content in the background
React Dev Tools
- Install in Chrome or Firefox: https://reactjs.org/blog/2019/08/15/new-react-devtools.html#how-to-get-it
- Useful for inspect state and props in production
Profiler API
React DevTools Profiler
- Introducing the React Profiler โข React Blog ๐
- Profile a React App for Performance โข Kent C. Dodds ๐
- Debugging React applications with the React Profiler API and the Profiler DevTool โข LogRocket Blog ๐
Profiler component
- Profiler โข React docs ๐
- React Production Performance Monitoring โข Kent C. Dodds ๐
- The definitive guide to profiling React applications โข Ovie Okeh ๐
Preventing unwanted rerenders
- Why React Re-Renders โข Josh Comeau ๐
- Use React.memo() wisely โข Dmitri Pavlutin ๐
- JSX was a Mistake โข Kyle Shevlin ๐
- Careful with Context Composition โข Kyle Shevlin ๐
View more list items
const ItemsWithViewMore = ({ items, initialLimit, increment }) => {
const [limit, setLimit] = useState(initialLimit)
const visibleItems = items.slice(0, limit)
const handleViewMoreClick = () => setLimit(limit + increment)
return (
<section>
<h2>Items</h2>
<ul>
{visibleItems.map(item => (
<Item {...item} />
))}
</ul>
{visibleItems.length < items.length && (
<button onClick={handleViewMoreClick}>View more</button>
)}
</section>
)
}
Inbox
-
preact: signals: Signal Boosting | Preact: Fast 3kb React alternative with the same ES6 API. Components & Virtual DOM. โข Thorough explanation of how
signal
,computed
andeffect
work โข Preact ๐ -
Million Lint โข Linter for react performance problems โข Million.js ๐ ๏ธ
-
Expo in 100 Seconds - a framework that generates a web, ios and android app that use native platform APIs from a single React Native codebase - Fireship
-
shadcn/ui - frontend UI library
-
Expo - Create universal native apps with React and TypeScript that run on Android, iOS and the web
-
reactjs - Material-UI Slider - Changing Values using Scale - Stack Overflow - a working approach to scaling values on a slider so intermediate marks that arenโt equally far apart numerically can be shown equally far apart visibly (see soluble factor concentration slider in mapapp)
-
The โWrong Wayโ To Use React โข Render on fetch instead of fetching on render โข Theo ๐บ
-
5 Misconceptions about React Server Components โข Builder.io ๐