-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add note about TypeScript requiring types for namespaced attributes #954
base: main
Are you sure you want to change the base?
Conversation
Run & review this pull request in StackBlitz Codeflow. |
✅ Deploy Preview for solid-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nits about using the built components for highlighting/callout
@@ -19,3 +19,5 @@ This attribute is most useful for Web Components. | |||
<my-element /> | |||
|
|||
``` | |||
|
|||
Note: Type definitions are required when using TypeScript. See the [TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the Callout component
<Callout type="info" title="Strong-Typing Custom Properties">...</Callout>
@@ -8,3 +8,5 @@ Forces the prop to be treated as a property instead of an attribute. | |||
```tsx | |||
<div prop:scrollTop={props.scrollPos + "px"} /> | |||
``` | |||
|
|||
Note: Type definitions are required when using TypeScript. See the [TypeScript](/configuration/typescript#forcing-properties-and-custom-attributes) page for examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the Callout component
<Callout type="info" title="Strong-Typing Custom Properties">...</Callout>
Description(required)
Someone made a note on discord that for example
prop:scrollTop
gives a type error, and asked if that was a bug. Related docs page https://docs.solidjs.com/reference/jsx-attributes/propI understood the expectation, given that there is no indication that the typings for such a prop must be provided by the user. I understand we do not want to include types on each page and have a special page for types instead. So I'm including a note on each special namespaced attributes page indicating that the types must be provided and linking to the examples given in the TypeScript page
I'm not that sure about the format of the note as in "Note: text", or could be a callout but maybe It's too much, maybe we can bold the "Note" part?
Related issues & labels