Skip to content

zspitz/strict-mode-ts

Repository files navigation

React Strict Mode Samples

Uses TypeScript + React (obviously) + Vite

Has a number of components to help explain exactly what StrictMode does.

  • GeoData - shows the basic problem: code runs after component has refreshed (although StrictMode doesn't help here)
  • TeaSet - storing external data that is modified after each render
  • StoryTray - affecting objects/arrays passed in as props
  • IntervalCounter - Effects-code remaining after render

Component re-render can be triggered by toggling the theme with the button at the top of the page.

Component mount/unmount can be triggered using the checkbox.

To install:

npm i

To run:

npm run dev

Fixes for the various issues can be found in the fixes branch.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published