diff --git a/eslint.config.mjs b/eslint.config.mjs index 9375e8cb..f2dfb865 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -13,6 +13,7 @@ export default defineConfig([ ignores: [ 'www/out', 'out/', + 'node/', 'packages/node/src/api-links/__tests__/fixtures/', ], }, diff --git a/packages/react/src/html/ui/hooks/useOrama.mjs b/packages/react/src/html/ui/hooks/useOrama.mjs index 30a5903c..4b6f068d 100644 --- a/packages/react/src/html/ui/hooks/useOrama.mjs +++ b/packages/react/src/html/ui/hooks/useOrama.mjs @@ -14,6 +14,9 @@ export default pathname => { const loaded = useRef(null); useEffect(() => { + // Reset loaded state when pathname changes + loaded.current = null; + // Create the database instance const db = create({ schema: {}, @@ -45,8 +48,8 @@ export default pathname => { return search(db, options); }; - setClient(db); - }, []); + queueMicrotask(() => setClient(db)); + }, [pathname]); return client; }; diff --git a/packages/react/src/html/ui/islands/withIsland.jsx b/packages/react/src/html/ui/islands/withIsland.jsx index 6c4bde22..b7043ff5 100644 --- a/packages/react/src/html/ui/islands/withIsland.jsx +++ b/packages/react/src/html/ui/islands/withIsland.jsx @@ -48,6 +48,7 @@ export default (Component, { name, on }) => { {toChildArray(children).map((child, index) => ( + // eslint-disable-next-line react-x/no-array-index-key -- static server-rendered children never reorder {child}