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

Improve TypeScript support for $$restProps, class/style as functions #43

Closed
rgossiaux opened this issue Feb 1, 2022 · 0 comments · Fixed by #81
Closed

Improve TypeScript support for $$restProps, class/style as functions #43

rgossiaux opened this issue Feb 1, 2022 · 0 comments · Fixed by #81
Milestone

Comments

@rgossiaux
Copy link
Owner

Because these components spread $$restProps all over the place, the TypeScript support for props besides those exported by the component is lacking. Concretely that means:

  • Props which <Render> uses which come via $$restProps: class and style--particularly when using them as functions.
  • Props which are spread all the way down to the underlying HTML elements.

It would be nice if we could do this semi-automatically (sveltejs/language-tools#1363), but we can also use $$Props to type the component manually. Ideally we can get support for some similar $$RestProps type of interface (suggesting this to the language-tools folks) but if not we can still use $$Props--it'll just be a bit more painful since we now have to worry about forgetting to add any props there.

@rgossiaux rgossiaux added this to the 1.0 milestone Feb 12, 2022
@rgossiaux rgossiaux linked a pull request Mar 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant