Skip to content

Commit cf3c7eb

Browse files
committed
fix: add global alias
Signed-off-by: Innei <[email protected]>
1 parent 2eb880a commit cf3c7eb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/common/Global.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use client'
22

3-
import React, { useLayoutEffect } from 'react'
3+
import React from 'react'
44
import ReactDOM from 'react-dom'
5-
6-
import * as Button from '~/components/ui/button'
5+
import { useIsomorphicLayoutEffect } from 'foxact/use-isomorphic-layout-effect'
76

87
export const Global = () => {
9-
useLayoutEffect(() => {
8+
useIsomorphicLayoutEffect(() => {
109
Object.assign(window, {
1110
React,
1211
ReactDOM,
13-
ShiroComponents: { ...Button },
12+
react: React,
13+
reactDom: ReactDOM,
1414
})
1515
}, [])
1616
return null

0 commit comments

Comments
 (0)