19 lines
317 B
TypeScript
Raw Normal View History

2023-06-30 01:46:42 +00:00
import React, { useContext } from 'react'
import { StateContext } from '~/Providers/State'
const getGlobal = () => {
try {
return window
} catch {
return globalThis
}
}
export const useState = (props?: any) => {
const { state, addState } = useContext(StateContext)
return { state, addState }
}