WIP 2.0.0: React Compiler lint rules back to errors; docs
- The 192 places the rules flagged are fixed and the rules are errors again (npx eslint src: nothing). lib/hooks.ts: useStateSync (state that follows other state, set while rendering), useExternalEffect (API loads and browser reads), useNow; lib/navigation.ts hardNavigate for full reloads after sign-out or identity switches; other pages use the router. Resets moved into the handlers that cause them. - The banner shows and hides at its times on open pages. - HANDOVER, roadmap, README, FEATURES, SETTINGS, CHANGELOG updated; 2.0.0 section drafted in WHATS-NEW. e2e 102/102 (PayFast sandbox skipped); production build passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import React, { createContext, useContext, useEffect, useState } from "react";
|
||||
import React, { createContext, useContext, useState } from "react";
|
||||
import { apiV2Data } from "@/lib/apiV2";
|
||||
import { useExternalEffect } from "@/lib/hooks";
|
||||
|
||||
export type SiteSettings = {
|
||||
org_name?: string;
|
||||
@@ -63,7 +64,7 @@ export function SiteSettingsProvider({
|
||||
// Always refreshes in the background (cheap, 60s-cached server-side) even
|
||||
// when seeded from initialSettings — self-heals if the SSR fetch in
|
||||
// layout.tsx failed, and picks up any change since that request.
|
||||
useEffect(() => { load(); }, []);
|
||||
useExternalEffect(() => { load(); }, []);
|
||||
|
||||
return (
|
||||
<SiteSettingsContext.Provider value={{ settings, loading, reload: load }}>
|
||||
|
||||
Reference in New Issue
Block a user