fix(Accordion): generate key for the Accordion.Content#305
Conversation
-fixed complex accordion content example to contain key and content
Codecov Report
@@ Coverage Diff @@
## master #305 +/- ##
=======================================
Coverage 89.63% 89.63%
=======================================
Files 62 62
Lines 1167 1167
Branches 150 150
=======================================
Hits 1046 1046
Misses 119 119
Partials 2 2
Continue to review full report at Codecov.
|
|
@mnajdova may be the better idea will be to pick the This allow handle keys on panels: const panels = [
{
key: 'what-is-dog',
title: 'What is a dog?',
content: 'A dog is a type of domesticated animal.',
},
{
key: 'kinds-of-dogs',
title: 'What kinds of dogs are there?',
content: 'There are many breeds of dogs.',
},
] |
|
@layershifter thanks for the reference on the AccordionPanel. I would not make that big changes at this moment, as the only issue we hit so far was the generation of the content's key which if fix with this PR. We can however consider refactoring this in the future, but I see having more things that should be considered, as supporting the |
|
@mnajdova @layershifter please create an RFC for further discussion around Accordion panels. |
CHANGELOG.md
Outdated
|
|
||
| ### Fixes | ||
| - Fix Attachment `styles` prop typing @levithomason ([#299](https://github.com/stardust-ui/react/pull/299)) | ||
| - Fix generation of key for the Accordion.Content @mnajdova ([#305](https://github.com/stardust-ui/react/pull/305)) |
There was a problem hiding this comment.
meaning, that you can add the `
Fix
This PR fixes #291
TODO
There was a bug in the creation of the Content which prevented generation of keys, and a small bug where the complex content for the Accordion.Content was created. Those two are fixed now.
Important note
We support generation of keys, for the component that as content has some primitive value (string, number etc). If the content is something more complex (as in the last example of the docs), that the user is responsible for creating the key.