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

Rewrite in Typescript: Spinner #317

Closed
wants to merge 16 commits into from

Conversation

zaki-yama
Copy link
Collaborator

ref. #289

TODO: after #316 is merged, change base branch to 3.0.

@zaki-yama zaki-yama self-assigned this Jun 21, 2019
@zaki-yama zaki-yama force-pushed the typescript-spinner branch from cb1d516 to c26166e Compare June 21, 2019 22:33
@stomita stomita mentioned this pull request Jun 23, 2019
41 tasks
@@ -34,27 +45,14 @@ export default class Spinner extends React.Component {
}

render() {
const { container, ...props } = this.props;
const { container = true, size = 'small', ...props } = this.props;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stomita
I quit using defaultProps and use destructuring assignment instead.
It works, but I couldn't make use of type check here, it means I can assign any value to both container and size.
If you know any good solution, please tell me.

@@ -17,19 +18,21 @@ storiesOf('Spinner', module)
.add(
'Controlled with knobs',
() => {
// TODO: After https://github.com/storybookjs/storybook/issues/4487 is solved,
// - Add `undefined` to sizeOptions.
// - Change '' to `undefined` in typeOptions.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem that I can't add { '(none)': undefined } to sizeOptions is because of addon-knobs' issue:
addon-knobs select should be able to have undefined options. · Issue #4487 · storybookjs/storybook

First I fixed the component logic itself to work properly if given empty string (b438ac3).
But I thought we shouldn't change the logic for the story.

@zaki-yama
Copy link
Collaborator Author

Closed because the last PR #342 had been merged.

@zaki-yama zaki-yama closed this Oct 28, 2019
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 this pull request may close these issues.

1 participant