Releases: roginfarrer/collapsed
Releases · roginfarrer/collapsed
v3.0.0-2
- Fix Git history
v3 featuring TypeScript and auto transition duration for variable height!
What's new?
- Rewritten in TypeScript
- BREAKING New calculated duration based on the height of the collapsed element-- made the default
2.2.3
v2.2.2
v2.2.1
`collapsedHeight`
Added support for collapsedHeight
#20
v2.0.0
2.0.0 (2019-03-10)
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>
</>
);
}
Refactor to use react-hooks
import {useCollapse} from 'react-collapsed';