Conversation
types/utils.d.ts
Outdated
@@ -12,3 +12,4 @@ export type Extendable<T> = T & { | |||
|
|||
export type ItemShorthand = React.ReactNode | object | (React.ReactNode | object)[] | |||
export type ReactChildren = React.ReactNodeArray | React.ReactNode | |||
export type SyntheticEventHandler<TProps> = (event: React.SyntheticEvent, data: TProps) => void |
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.
Propose we call this something like StardustEventHandler
. The signature here is unique to Stardust and does not apply all synthetic event handlers.
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.
agree with the reasons provided, but would rather suggest to use ComponentEventHandler
then. The problem I see with using StardustEventHandler
is that with the approach of prefixing library-specific types with 'Stardust' we would potentially need to introduce this prefix to other types too (ItemShorthand
, as an example?). To me it seems reasonable to assume that all types that are introduced as part of the library are Stardust
ones, and there is no additional need to emphasize this :)
Let me, please, change it to ComponentEventHandler
for now and make a promise to rename it in case it won't work well for us
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.
One suggestion, see comment.
Codecov Report
@@ Coverage Diff @@
## master #148 +/- ##
==========================================
- Coverage 69.2% 69.17% -0.03%
==========================================
Files 101 101
Lines 1341 1340 -1
Branches 251 250 -1
==========================================
- Hits 928 927 -1
Misses 411 411
Partials 2 2
Continue to review full report at Codecov.
|
This PR introduces props interface for the Label component, as part of #117