Skip to content

Commit ccfdba7

Browse files
authored
Fix example not using props (#1030)
1 parent 4e1d35a commit ccfdba7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/routes/concepts/context.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,8 @@ import { createSignal, createContext, useContext } from "solid-js";
109109
import { CounterContext } from "~/context/counter";
110110

111111
export function CounterProvider(props) {
112-
let count = 0;
113-
114112
return (
115-
<CounterContext.Provider value={count}>
113+
<CounterContext.Provider value={props.count ?? 0}>
116114
{props.children}
117115
</CounterContext.Provider>
118116
);

0 commit comments

Comments
 (0)