From 73164696df42aa9df9eb05c8d3f6982ff92a06ec Mon Sep 17 00:00:00 2001 From: Jamie Kyle Date: Mon, 13 May 2019 17:01:10 -0700 Subject: fix example --- example/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/example/index.tsx b/example/index.tsx index 89c325d..566ebaf 100644 --- a/example/index.tsx +++ b/example/index.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react" import { createContainer } from "../src/unstated-next" import { render } from "react-dom" -function useCounter() { +function useCounter(initialState = 0) { let [count, setCount] = useState(initialState) let decrement = () => setCount(count - 1) let increment = () => setCount(count + 1) @@ -14,11 +14,11 @@ let Counter = createContainer(useCounter) function CounterDisplay() { let counter = Counter.useContainer() return ( - <> +
{counter.count} - +
) } @@ -26,7 +26,7 @@ function App() { return ( - +
-- cgit v1.2.3