import create, { saveHistory } from "stalo/lib/persistent"; import { useEffect } from "react"; import { useHashLocation } from "wouter/use-hash-location"; const [useCount, setCount, setCountByStorage] = create(0); export default function CounterPersistent() { // Update the count when the location changes. const [location] = useHashLocation(); useEffect(setCountByStorage, [location]); return ( <>