aboutsummaryrefslogtreecommitdiff
path: root/src/unstated-next.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/unstated-next.tsx')
-rw-r--r--src/unstated-next.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/unstated-next.tsx b/src/unstated-next.tsx
index 5a28ba3..f91495d 100644
--- a/src/unstated-next.tsx
+++ b/src/unstated-next.tsx
@@ -1,5 +1,7 @@
import React from "react"
+const EMPTY: unique symbol = Symbol()
+
export interface ContainerProviderProps<State = void> {
initialState?: State
children: React.ReactNode
@@ -13,7 +15,6 @@ export interface Container<Value, State = void> {
export function createContainer<Value, State = void>(
useHook: (initialState?: State) => Value,
): Container<Value, State> {
- const EMPTY: unique symbol = Symbol()
let Context = React.createContext<Value | typeof EMPTY>(EMPTY)
function Provider(props: ContainerProviderProps<State>) {