-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Update default props #2926
Update default props #2926
Conversation
Another dependency to update - our version of eslint does not seem to support the spread operator. eslint/eslint#10307
For example, this error is from defining the defaults like this in
There is an error for each component. |
@AnnMarieW can you please let us know if you're still working on this one or is it ready for review? thanks - @gvwilson |
Hi @gvwilson I'm afraid, I've hit a roadblock on this one. Here's the current status:
I found this project that parses the default props from the function signature in typescript components, however, I'm stuck trying to integrate that logic into extract-meta.js If someone could help with that piece, I could probably finish the rest (ie tests) However, I'm traveling for a few weeks, and would be happy to turn this project over to someone if you'd like to get it wrapped up sooner. |
@T4rk1n please have a look at this one and help @AnnMarieW move it forward when you can. thanks - @gvwilson |
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.
some questions but no blockers
@@ -32,7 +32,7 @@ export type TypescriptComponentProps = { | |||
array_elements?: JSX.Element[]; | |||
|
|||
string_default?: string; | |||
number_default?: string; | |||
number_default?: number; |
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.
this seems kind of important :-)
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.
I changed this to get tests to pass, but @T4rk1n can you confirm if this is OK?
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.
Yes that is the good type.
@@ -43,7 +44,7 @@ | |||
"import/named": ["off"], | |||
"import/namespace": ["off"], | |||
"import/no-duplicates": ["error"], | |||
"import/no-named-as-default": ["error"], | |||
"import/no-named-as-default": ["off"], |
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.
apologies, but can you please explain what the impact of this one will be?
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.
It's a linting that conflicted with the default notation on param functions.
display, | ||
color, | ||
display = 'auto', | ||
color = '#119DFF', |
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.
do we have colors and other constants scattered elsewhere through the code as well or is there a way to consolidate them all in one place? (very low priority, not worth holding up this PR for)
show = true, | ||
targetable = false, | ||
direction = 'right', | ||
border_color = '#d6d6d6', |
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.
again, can we (in future?) replace magic color constants with names that are all defined in one place?
closes #2919
I updated all the components listed in #2919 except for
dcc.Location
because it's still a class component.optionals
CHANGELOG.md