This repository was archived by the owner on Jun 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 49
All PropTypes are 'string' #71
Comments
...or rather than completely punting, we can only validate |
Closed
HTML attributes are all strings in the tags like xml, it's the jsx that have types. |
Yeah, I guess I meant to say a resource that maps each HTML attribute to the type it would have if HTML had a typing system like jsx does. The Mozilla docs does this sometimes, e.g. saying |
https://www.w3schools.com/tags/tag_textarea.asp the value column got some typing info. |
Only validating the children has been working pretty and no real problems were caused. We can revisit this is some issues come up |
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
A detail I noticed with the property validation PR is that all properties that are not
n_click
,n_click_timestamp
andchildren
indash-html-components
are strings.Some HTML
props
sort of behave like they are booleans, numbers, ect. and are transparently serialized to a string. For example,Details.open
can be set toTrue
which will serialize as'true'
, HTML interprets this as the presence of a string and sets the valueopen
to be true.This pattern currently breaks with the property validation PR (plotly/dash#340) since
props
havePropType.string
, you would have to set the value to be'true'
or some other string.I haven't been able to find a good resource that has each HTML attribute and its type, so I was thinking of just not validating anything from
dash-html-components
since having to convert everything to a string would get tedious.Anyone have any thoughts on this / ideas to remedy?
The text was updated successfully, but these errors were encountered: