-
Notifications
You must be signed in to change notification settings - Fork 17
Dev switch option #47
base: master
Are you sure you want to change the base?
Conversation
1. error when start storybook storybookjs/storybook#4116 2. use babel-loader@7.1.5 to avoid storybookjs/storybook#5249
why |
According to storybookjs/storybook#4116, |
What do you think about to take this an opportunity to expose an inversion of control? Thinking this is a very specific case and we are just adding much code there |
Do you have any ideas here? Cause react-clap-button is not a fully-controlled component, the Then users can implement switch effect if they want. |
const { count, countTotal, isClicked, isHover } = this.state | ||
const { iconComponent: ClapIcon } = this.props | ||
const { iconComponent: ClapIcon, canSwitch } = this.props | ||
const clapCountText = canSwitch ? `${isClicked ? '+' : '-'}1` : `+${count}` |
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.
please change the hard-coded count +1
.
What if there is the case where synchronization is used to make a real-time update for the clapCountText
?
If that so we have to compare the current count with the previous count, cannot just depend on isClicked
closes #46