Skip to content

Commit

Permalink
fix: add global alias
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Feb 12, 2024
1 parent 2eb880a commit cf3c7eb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/common/Global.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit cf3c7eb

Please sign in to comment.