Comments (2)
How about this?
function Collapse(props) {
const collapseProps = useCollapse(props);
return props.children(collapseProps);
}
https://codesandbox.io/s/usecollapse-as-a-render-component-67tnd
You can make a component that uses the render prop API. It's props become the initial config, and you don't need to use a hook.
from collapsed.
Closing due to inactivity.
from collapsed.
Related Issues (20)
- If the height is changed from the outside while the open/close process has never been executed, it will not synchronize. HOT 5
- Remove raf dependency HOT 1
- Since switching to createRoute (concurrent React), inline styles are sometimes not updated HOT 15
- Dependency Dashboard
- No longer compatible with React < 18. HOT 2
- can we replace useEffectAfterMount HOT 2
- Use expand on a Table cell on react HOT 2
- New version doesn't toggle HOT 9
- Media query collapsed HOT 2
- Incorrect peer dependency HOT 1
- SSR usage - prevent initially display if not expanded by default HOT 5
- OffsetHeight vs ScrollHeight HOT 3
- hasDisabledAnimation isn't `false` by default HOT 3
- Request to update "react-collapsed" CONTRIBUTING.md due to old version and package manager conversion.
- Safari 13 support, or at least graceful error handling? HOT 3
- Read more effect HOT 3
- Code for accordion storybook incomplete
- Is it possible to have 2 icons switch back and forth when expanding or collapsing? HOT 1
- We should have multiple collapse/accordion option in a single component
- inline styling not working HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collapsed.