solidjs / solid-docs-next

SolidJS Docs.
https://docs.solidjs.com/
212 stars 244 forks source link

fix: create a const for the counter object #693

Closed ubmit closed 4 months ago

ubmit commented 4 months ago

In the "Update Context Values" section (https://docs.solidjs.com/concepts/context#updating-context-values), in the snippet for Context.jsx, it seems that no variable is being initialized for the counter object.

Also, I think there's a typo on the line above it. The line ends with a , instead of ;.

stackblitz[bot] commented 4 months ago

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

netlify[bot] commented 4 months ago

Deploy Preview for solid-docs ready!

Name Link
Latest commit e74104786bd4f05867ae5c77c3be5064e7c7c2ce
Latest deploy log https://app.netlify.com/sites/solid-docs/deploys/662c1cfe32de3400086664bf
Deploy Preview https://deploy-preview-693--solid-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

atilafassina commented 4 months ago

That's valid JavaScript.

const foo = "var1",
      bar = "var2";

is the same as

const foo = "var1";
const bar = "var2";

But I think your change makes it more readable. Thank you!

ubmit commented 4 months ago

That's valid JavaScript.

const foo = "var1",
      bar = "var2";

is the same as

const foo = "var1";
const bar = "var2";

But I think your change makes it more readable. Thank you!

oooh TIL! I knew one could write const foo = "var1", bar = "var2"; but I thought it had to be on the same line for some reason 😂