From cf3c7ebb8a2bed0c10f006e5be362ff4b7395c12 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 12 Feb 2024 14:26:25 +0800 Subject: [PATCH] fix: add global alias Signed-off-by: Innei --- src/components/common/Global.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/common/Global.ts b/src/components/common/Global.ts index ade98fd9e7..aeafd1b895 100644 --- a/src/components/common/Global.ts +++ b/src/components/common/Global.ts @@ -1,16 +1,16 @@ 'use client' -import React, { useLayoutEffect } from 'react' +import React from 'react' import ReactDOM from 'react-dom' - -import * as Button from '~/components/ui/button' +import { useIsomorphicLayoutEffect } from 'foxact/use-isomorphic-layout-effect' export const Global = () => { - useLayoutEffect(() => { + useIsomorphicLayoutEffect(() => { Object.assign(window, { React, ReactDOM, - ShiroComponents: { ...Button }, + react: React, + reactDom: ReactDOM, }) }, []) return null