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 😸 |
| } | ||
|
|
||
| AccordionTitle.create = createShorthandFactory(AccordionTitle, 'content') | ||
| AccordionTitle.create = createShorthandFactory({ Component: AccordionTitle, mappedProp: 'content' }) |
-reverted changes for the reactions
| Component: React.ReactType | ||
| mappedProp?: string | ||
| mappedArrayProp?: string | ||
| valueOrRenderCallback?: ShorthandValue | ShorthandRenderCallback |
There was a problem hiding this comment.
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
|
|
||
| const valIsPrimitive = typeof value === 'string' || typeof value === 'number' | ||
| const valIsPropsObject = _.isPlainObject(value) | ||
| const valIsArrayObject = _.isArray(value) |
There was a problem hiding this comment.
Will change it to valueIsArray :)
This PR fix #984 by allowing arrays to be used together with the shortand props which are representing collection.