I need onMouseMove event in Button, but I'd like to use our generic Button component.
Details
Tested if buttons work.
New functionality tested in next diffs, where I used event.
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Changed mouseOver to mouseMove so it triggers correctly.
It begs a questions whether I should even try to use generic Component and not plain html tag, if use case is so custom.
web/components/button.react.js | ||
---|---|---|
38 ↗ | (On Diff #19170) | Yeah, I agree, I was surprised that props were limited in such way. Should I do it in this diff, or create issue for that and continue in another diff? |
web/components/button.react.js | ||
---|---|---|
37–43 ↗ | (On Diff #19220) | I've only left things that have default values, or are later explicitly needed in component for further processing. |
web/components/button.react.js | ||
---|---|---|
41 ↗ | (On Diff #19220) | We're no longer setting the default value. Is it intentional? Do we still need to destructure this prop from props or maybe it is better to keep it inside buttonProps? |
46–72 ↗ | (On Diff #19220) | It wasn't introduced in this diff, but it's better to use classNames when composing the classes |
Awesome, thanks for making that change!! Please address @tomek's comments before landing
Using classNames.
web/components/button.react.js | ||
---|---|---|
41 ↗ | (On Diff #19220) | We need it as they are used below to create wrappedChildren: const wrappedChildren = React.Children.map(children, child => { if (typeof child === 'string' || typeof child === 'number') { return <span>{child}</span>; } return child; }); Is there a way to access them if they are destructured here? |