Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error with example routing code #822

Open
tslocke opened this issue Jul 23, 2024 · 0 comments
Open

Type error with example routing code #822

tslocke opened this issue Jul 23, 2024 · 0 comments
Assignees
Labels
improve documentation Enhance existing documentation. pending review Awaiting review by team members.

Comments

@tslocke
Copy link

tslocke commented Jul 23, 2024

📚 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

@tslocke tslocke added improve documentation Enhance existing documentation. pending review Awaiting review by team members. labels Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve documentation Enhance existing documentation. pending review Awaiting review by team members.
Projects
None yet
Development

No branches or pull requests

2 participants