Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hamlim/recycles
React lifecycle render-prop components ♻️
https://github.com/hamlim/recycles
lifecycle react render-props
Last synced: 2 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 (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T10:45:00.000Z (about 2 years ago)
- Last Synced: 2024-10-11T20:19:49.097Z (3 months ago)
- Topics: lifecycle, react, render-props
- Language: JavaScript
- Homepage:
- Size: 501 KB
- Stars: 16
- Watchers: 4
- Forks: 0
- Open Issues: 10
-
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()
}}
,
)
```