fix: rerender i18n in host components on lang change (#6224)

This commit is contained in:
David Luzar 2023-02-22 15:01:23 +01:00 committed by GitHub
parent e4506be3e8
commit 04a8c22f39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 88 additions and 72 deletions

View file

@ -1,4 +1,4 @@
import { unstable_createStore, useAtom, WritableAtom } from "jotai";
import { PrimitiveAtom, unstable_createStore, useAtom } from "jotai";
import { useLayoutEffect } from "react";
export const jotaiScope = Symbol();
@ -6,7 +6,7 @@ export const jotaiStore = unstable_createStore();
export const useAtomWithInitialValue = <
T extends unknown,
A extends WritableAtom<T, T>,
A extends PrimitiveAtom<T>,
>(
atom: A,
initialValue: T | (() => T),