Changelog has been moved to the releases tab.
- 3e498c4: Updated react peer dependency versions to include React 19
-
42793ee: NOTE: See
packages/react-collapsed
for stable API.Complete rewrite using rewritten
@collapsed/core
. API remains the same.
- Updated dependencies [42793ee]
- @collapsed/[email protected]
- cd21fd4: Remove package.json exports
- Updated dependencies [cd21fd4]
- @collapsed/[email protected]
-
1ee93e8: ## BREAKING CHANGES
- Adopts React 18's
useId
, making the library incompatible with React <18 - Switch to
tsup
frommicrobundle
for bundling library. No longer exports a UMD version, just CJS and MJS
- Refactors core functionality to vanilla JS (with a React) adapter, which I think should fix #103 and fix #100
- Added
onExpandedChange
option - Tries to detect if
getToggleProps
is used. If the toggle element ref can be accessed, thearia-labelledby
attribute will be added to the collapse element - Added
role="region"
to collapse - Updated toggle props to pass the appropriate attributes to the element, whether it's a button or not
- Adopts React 18's
- Updated dependencies [1ee93e8]
- @collapsed/[email protected]
Complete rewrite using React hooks!
- Ends support for React versions < 16.8.x
- Library now exports a custom hook in lieu of a render prop component
- Adds support for unmounting the contents of the Collapse element when closed
import React from "react";
import useCollapse from "react-collapsed";
function Demo() {
const { getCollapseProps, getToggleProps, isOpen } = useCollapse();
return (
<>
<button {...getToggleProps()}>{isOpen ? "Collapse" : "Expand"}</button>
<section {...getCollapseProps()}>Collapsed content 🙈</section>
</>
);
}
Bumped to full release! :)
duration
,easing
, anddelay
now support taking an object within
andout
keys to configure differing in-and-out transitions
getCollapsibleProps
=>getCollapseProps
. Renamed since it's easier to spell 😅
- Slew of Flow bug fixes
- Improved documentation
- ESLINT wasn't working properly - fixed this
- Added
files
key to package.json to improve NPM load