Comments (5)
Hi @suvnshr go for it!
from vibe.
Hi @orrgottlieb, I would like to pick this up.
I would be following the patterns used in the .tsx and .ts files already present in the project.
from vibe.
Hey @orrgottlieb
I'm wanted you to review some changes before I commit them, coz I think I will have to make changes to Button.tsx and Icon.tsx:
The close button snippet used in Button.jsx, cannot be used as is in Button.tsx because of a lot of restrictions of types:
- Button has a
string
type defined forchildren
prop
- But I have seen a lot of
Button
snippets in the code where thechildren
is not alwaysstring
- Adding a
React.Element
type to the Button'schildren
prop fixes this.
- iconSubComponentProps has only
string
type for thesize
prop , butCloseSmallProps
hasstring | number
for size props
- Adding a
number
to size prop iniconSubComponentProps
fixes this
- iconSubComponentProps has only
React.MouseEvent<HTMLElement>
for onClick mouse events , butCloseSmallProps
extendsReact.SVGAttributes<SVGElement>
which sends mouse event asReact.MouseEvent<SVGElement>
- Adding a
React.MouseEvent<SVGElement>
to the mouse events of the onClick listener fixes this.
So my question is shall I go ahead and add the required types in Button.tsx and Icon.tsx?
I have ran all tests after making the above changes, and there were no failures.
PS: If I am not supposed to make the above changes then let me know how I can render that Button without triggering the above violations, thanks!
from vibe.
Hi @suvnshr thank you for the comments
- please fix the way that you suggested adding the
React.Element
type, you may (if you want) replace thestring
type with it - awesome solution, go for it!
- we are using
HTMLElement
quite a lot, can you please add a type there that it is eitherHTMLElement | SVGElement
in the types folder here, thank you
As this migration process is a work in progress you can fix types according to new needs
from vibe.
Ok sure. Will do the changes.
Thanks!
from vibe.
Related Issues (20)
- [Feat]: ModalFooterButtons - be able to disable primary button
- [Feat]: ModalFooterButtons - be able to show/hide secondary button
- [Bug]: Dropdown with multiselect and size small has several issues HOT 2
- [Type]: change "icon" prop type to SubIcon in ModalHeader and Tab HOT 3
- [Bug]: hideCloseButton in modal - not working HOT 3
- [Bug]: multiple issues with dropdown HOT 1
- [Bug]: DatePicker | no null protection for onPickDate callback HOT 1
- [Bug]: Dropdown virtualized menu - wrong height calculation HOT 1
- [Types]: Typography - change tooltipProps type to Partial<TooltipProps> HOT 1
- [Types]: Avatar - change tooltipProps type to Partial<TooltipProps> HOT 1
- [Refactor] AlertBanner - replace Button + Icon with IconButton HOT 1
- [Feat] `onClear` attribute for the `Search` component HOT 2
- [Bug]: Dropdown font is broken
- [Docs]: convert Menu.stories.js to TS HOT 3
- [Docs]: convert AlertBanner.stories.js to TS HOT 4
- [Docs]: convert AvatarGroup.stories.js to TS
- [Docs]: convert Skeleton.stories.js to TS HOT 1
- [Bug]: Tooltip component is flickering HOT 1
- [Bug]: Combobox - when there are no items there is a redundant spacing below the search input
- [Bug]: Warning Toast Type renders nothing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vibe.