-
Notifications
You must be signed in to change notification settings - Fork 65
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
Remove unnecessary type casting in examples #221
Conversation
Codecov Report
@@ Coverage Diff @@
## master #221 +/- ##
======================================
Coverage 99.1% 99.1%
======================================
Files 19 19
Lines 1000 1000
Branches 300 300
======================================
Hits 991 991
Misses 1 1
Partials 8 8 Continue to review full report at Codecov.
|
src/slidepane/example/index.ts
Outdated
open: this.state.open, | ||
underlay: this.state.underlay, | ||
align: this.state.align, | ||
onRequestClose: () => this.setState({ open: false }), |
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 doesn't actually return anything so shouldn't be inline
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 see it is done elsewhere also, I think the style guide also says that if there is no return then the implicit return shouldn't be used.
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.
Seems cool, just a small query
src/select/example/index.ts
Outdated
onChange: (option: OptionData) => { | ||
this.setState({ value2: option.value }); | ||
} | ||
onChange: (option: OptionData) => this.setState({ value2: option.value }) |
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.
Same comment as @agubler made below about not using implicit return
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.
Looks good! Just the questions about implicit return and the currently-still-exported types.
@@ -31,49 +31,49 @@ export class App extends AppBase<WidgetProperties> { | |||
w(TextInput, { | |||
key: 't1', | |||
label: 'Name', | |||
type: <TextInputType> 'text', | |||
type: 'text', |
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 things like ButtonType
and TextInputType
still need to be exported now that we don't need to do this?
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 think they should still be made available to downstream users.
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.
Cool, looks good to me!
Type: feature
The following has been addressed in the PR:
Description:
This PR removes once-necessary type casting from examples. The issue was evident when grabbing values from state and passing them to child components as properties.
Resolves #217