Fix build error

This commit is contained in:
Zoe Roux 2023-03-11 12:39:31 +09:00
parent ea53eb9b24
commit 9f5b5282b1
2 changed files with 4 additions and 1 deletions

View File

@ -83,6 +83,7 @@ const GlobalCssTheme = () => {
const YoshikiDebug = ({ children }: { children: JSX.Element }) => { const YoshikiDebug = ({ children }: { children: JSX.Element }) => {
if (typeof window === "undefined") return children; if (typeof window === "undefined") return children;
// eslint-disable-next-line react-hooks/rules-of-hooks
const registry = useStyleRegistry(); const registry = useStyleRegistry();
return <StyleRegistryProvider registry={registry}>{children}</StyleRegistryProvider>; return <StyleRegistryProvider registry={registry}>{children}</StyleRegistryProvider>;
}; };

View File

@ -19,10 +19,12 @@
*/ */
import { useWindowDimensions } from "react-native"; import { useWindowDimensions } from "react-native";
import { AtLeastOne, Breakpoints as YoshikiBreakpoint } from "yoshiki/dist/type"; import { Breakpoints as YoshikiBreakpoint } from "yoshiki/dist/type";
import { isBreakpoints } from "yoshiki/dist/utils"; import { isBreakpoints } from "yoshiki/dist/utils";
import { breakpoints } from "yoshiki/native"; import { breakpoints } from "yoshiki/native";
type AtLeastOne<T, U = { [K in keyof T]: Pick<T, K> }> = Partial<T> & U[keyof U];
export type Breakpoint<T> = T | AtLeastOne<YoshikiBreakpoint<T>>; export type Breakpoint<T> = T | AtLeastOne<YoshikiBreakpoint<T>>;
// copied from yoshiki. // copied from yoshiki.