aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Kyle <me@thejameskyle.com>2020-05-04 20:54:42 +0300
committerGitHub <noreply@github.com>2020-05-04 20:54:42 +0300
commitd74dd3380f9e54bbe20dd5b6c8faeb5ba6011c42 (patch)
tree29c2e438eea6c36b811f19f82f034fd488813bd8
parenta1b2d71f8c914966e485aba62fe0ef8cc3839d83 (diff)
Update 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>) {