fix: make tunnels work in multi-instance scenarios (#6178)
* fix: make tunnels work in multi-instance scenarios * factor tunnels out * use tunnel-rat fork until upsteam updated
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { atom, useAtom } from "jotai";
|
||||
import React, { useLayoutEffect } from "react";
|
||||
import { useTunnels } from "../context/tunnels";
|
||||
|
||||
export const withInternalFallback = <P,>(
|
||||
componentName: string,
|
||||
@ -17,7 +18,8 @@ export const withInternalFallback = <P,>(
|
||||
__fallback?: boolean;
|
||||
}
|
||||
> = (props) => {
|
||||
const [counter, setCounter] = useAtom(counterAtom);
|
||||
const { jotaiScope } = useTunnels();
|
||||
const [counter, setCounter] = useAtom(counterAtom, jotaiScope);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
setCounter((counter) => counter + 1);
|
||||
|
Reference in New Issue
Block a user