-
Notifications
You must be signed in to change notification settings - Fork 55
chore(shorthands): allow arrays as shorthand value #996
chore(shorthands): allow arrays as shorthand value #996
Conversation
Codecov Report
@@ Coverage Diff @@
## master #996 +/- ##
==========================================
+ Coverage 81.34% 81.39% +0.05%
==========================================
Files 673 673
Lines 8666 8692 +26
Branches 1467 1471 +4
==========================================
+ Hits 7049 7075 +26
Misses 1602 1602
Partials 15 15
Continue to review full report at Codecov.
|
docs/src/examples/components/Chat/Content/ChatExampleReactionGroup.shorthand.tsx
Outdated
Show resolved
Hide resolved
I like the idea with object config, we can apply it to other factories ( |
It's not enough to close the matching issue 😸 |
@@ -90,6 +90,6 @@ class AccordionTitle extends UIComponent<ReactProps<AccordionTitleProps>, any> { | |||
} | |||
} | |||
|
|||
AccordionTitle.create = createShorthandFactory(AccordionTitle, 'content') | |||
AccordionTitle.create = createShorthandFactory({ Component: AccordionTitle, mappedProp: 'content' }) |
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.
👍
-reverted changes for the reactions
Component: React.ReactType | ||
mappedProp?: string | ||
mappedArrayProp?: string | ||
valueOrRenderCallback?: ShorthandValue | ShorthandRenderCallback |
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.
Not sure about this name here... Would rather have value, as it is much simpler and shorter...
…shorthand-factory # Conflicts: # packages/react/src/components/Dropdown/DropdownSearchInput.tsx
packages/react/src/lib/factories.ts
Outdated
@@ -119,19 +149,21 @@ function createShorthandFromValue( | |||
|
|||
const valIsPrimitive = typeof value === 'string' || typeof value === 'number' | |||
const valIsPropsObject = _.isPlainObject(value) | |||
const valIsArrayObject = _.isArray(value) |
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.
what is ArrayObject
?
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.
Will change it to valueIsArray
:)
This PR fix #984 by allowing arrays to be used together with the shortand props which are representing collection.