Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/routes/(0)concepts/(4)context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export function App() {
import { createSignal, useContext } from "solid-js";

export function CounterProvider(props) {
const [count, setCount] = createSignal(props.initialCount || 0);
const [count, setCount] = createSignal(props.count || 0);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I almost think initialCount is more clear

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change wasn’t really about the naming itself. I changed it to count because that’s the prop name being passed to the other CounterProvider component, so I wanted to keep them consistent.

If keeping initialCount here makes more sense, I think we should also consider changing the prop passed to CounterProvider from count to initialCount for consistency.

I’m happy to make the necessary changes based on your preference.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<CounterProvider count={1}>

const counter = [
count,
{
Expand Down
Loading