feat: update jotai (#9015)
* feat: update jotai in excalidraw package * feat: update jotai in excalidraw-app * fix: exports from excalidraw/jotai * fix: use isolated react hooks * test: use jotai provider in <Trans /> test * remove unused package * refactor & make safer --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { atom, useAtom } from "jotai";
|
||||
import React, { useLayoutEffect, useRef } from "react";
|
||||
import { useTunnels } from "../../context/tunnels";
|
||||
import { atom } from "../../editor-jotai";
|
||||
|
||||
export const withInternalFallback = <P,>(
|
||||
componentName: string,
|
||||
@@ -13,9 +13,11 @@ export const withInternalFallback = <P,>(
|
||||
__fallback?: boolean;
|
||||
}
|
||||
> = (props) => {
|
||||
const { jotaiScope } = useTunnels();
|
||||
const {
|
||||
tunnelsJotai: { useAtom },
|
||||
} = useTunnels();
|
||||
// for rerenders
|
||||
const [, setCounter] = useAtom(renderAtom, jotaiScope);
|
||||
const [, setCounter] = useAtom(renderAtom);
|
||||
// for initial & subsequent renders. Tracked as component state
|
||||
// due to excalidraw multi-instance scanerios.
|
||||
const metaRef = useRef({
|
||||
|
||||
Reference in New Issue
Block a user