https://github.com/hamlim/recycles
React lifecycle render-prop components ♻️
https://github.com/hamlim/recycles
lifecycle react render-props
Last synced: 3 months ago
JSON representation
React lifecycle render-prop components ♻️
- Host: GitHub
- URL: https://github.com/hamlim/recycles
- Owner: hamlim
- Created: 2018-03-31T23:43:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-12T02:58:17.000Z (6 months ago)
- Last Synced: 2025-03-17T14:49:00.983Z (4 months ago)
- Topics: lifecycle, react, render-props
- Language: JavaScript
- Homepage:
- Size: 577 KB
- Stars: 16
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Recycles ♻️
Recycles is a simple React render-prop component library providing access to several React component lifecycle methods.
All of the exported components accept an optional `callback` prop and a `children` prop. Both of these are functions, and the components will return null if `callback` is undefined, otherwise they return `this.props.children()`.
## Example:
```jsx
import { ComponentDidMount } from 'recycles'render(
{() => {
// if your app was server side rendered, this only gets evaluated on the client
window.startTrackingOrSomething()
}}
,
)
```