solidjs / solid-docs-next

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

Type error with example routing code #822

Open tslocke opened 1 month ago

tslocke commented 1 month ago

📚 Subject area/topic

/solid-router/getting-started/component.mdx

📋 Page(s) affected (or suggested, for new content)

https://docs.solidjs.com/solid-router/getting-started/component

📋 Description of content that is out-of-date or incorrect

This page contains the sample code

<Route path="/hello-world" component={<h1>Hello World!</h1>} />

With typescript this gives a type error. It's expecting a function:

<Route path="/hello-world" component={() => <h1>Hello World!</h1>} />

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response