tic-tac-toe

Tic Tac Toe

Built with svelte, TS & vitejs

Tic Tac Toe

Game built with Svelte, TypeScript, Vite.

Structure

  • Container
  • Grid - 3X3
  • Cell
  • Winner/Turn display

Why is HMR not preserving my local component state?

HMR state preservation comes with a number of gotchas! It has been disabled by default in both svelte-hmr and @sveltejs/vite-plugin-svelte due to its often surprising behavior. You can read the details here.

If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.

// store.ts
// An extremely simple external store
import { writable } from 'svelte/store';
export default writable(0);

Top categories

Loading Svelte Themes