You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version 2.0 represents a total refactor, with a new context-based approach which should make this library more flexible, more maintainable and more comprehensively testable.
10
+
11
+
As this is a major release, users should expect some breaking changes - though they should be limited to the removal of the `activeItems` prop (read more below).
- Defect where controlled components' props were overridden by React.Children.map (https://github.com/springload/react-accessible-accordion/issues/33).
20
+
- Defect where accordion crashed with unexpected `children` types (https://github.com/springload/react-accessible-accordion/issues/45).
21
+
- Defect where React Accessible Accordion's components could not be extended.
22
+
- Defect where the `children` of `Accordion` or `AccordionItem` could not be arbitrary.
23
+
- Defect where `AccordionItem` had to be a child of `Accordion` (as opposed to to an arbitrary-level descendant).
24
+
- Defect where `AccordionItemBody` and `AccordionItemTitle` had to be children of `AccordionItem` (as opposed to arbitrary-level descendants).
25
+
26
+
### Removed:
27
+
28
+
- 🚨 Breaking change 🚨 `activeItems` property is no longer supported.
29
+
30
+
Control at the `Accordion` level (via the `activeItems` prop) and `AccordionItem` level (via the `expanded` prop) fought against one another, and choosing which control mechanism to give preference to would have been an arbitrary decision - and whichever way we went, we would have had test cases which demonstrated unusual/unpredictable behaviour. The `activeItems` mechanism was the obvious one to remove - it was arguably the "less React-y way", and we considered it more of a convenience than a feature. Crucially though, it fought too hard against the new architecture of the library, and keeping it would have prevented us enabling lots of other new features or resolving some of the issues that our users had raised.
31
+
32
+
If you're currently using activeItems, you're upgrade path might look like this:
Copy file name to clipboardExpand all lines: LICENSE
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# The MIT License (MIT)
2
2
3
-
Copyright (c) 2017 Springload
3
+
Copyright (c) 2018 Springload
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copy file name to clipboardExpand all lines: README.md
+35-41
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
> Accessible Accordion component for React. Inspired by [rc-collapse](https://github.com/react-component/collapse) and [react-sanfona](https://github.com/daviferreira/react-sanfona). :mag::ok_hand:
6
6
7
-
This is a work in progress. Feel free to contribute. [Try a demo now](https://springload.github.io/react-accessible-accordion/).
7
+
Try a demo now](https://springload.github.io/react-accessible-accordion/).
8
8
9
9
If you like accessible components, feel free to check this other repo [react-accessible-modal](https://github.com/springload/react-accessible-modal).
10
10
@@ -13,14 +13,12 @@ If you like accessible components, feel free to check this other repo [react-acc
<td>Indexes (or custom keys) to pre expand items. Can be changed dynamically. Doesn't have the priority against `AccordionItem - expanded` on first render.</td>
0 commit comments