https://github.com/andrewprifer/react-state-render-prop
A component for introducing state through render props. Especially useful for controlling arrays of controlled components. Written in TypeScript.
https://github.com/andrewprifer/react-state-render-prop
react react-component reactjs
Last synced: 17 days ago
JSON representation
A component for introducing state through render props. Especially useful for controlling arrays of controlled components. Written in TypeScript.
- Host: GitHub
- URL: https://github.com/andrewprifer/react-state-render-prop
- Owner: AndrewPrifer
- License: mit
- Created: 2020-03-05T20:57:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T09:11:32.000Z (over 2 years ago)
- Last Synced: 2025-03-14T17:16:31.911Z (about 1 month ago)
- Topics: react, react-component, reactjs
- Language: TypeScript
- Size: 1.27 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React State Render Prop
A component for introducing state through render props. Especially useful for controlling arrays of controlled components. Written in TypeScript.
## Installation
```sh
yarn add react-state-render-prop
```or
```sh
npm i react-state-render-prop
```## Usage
```tsx
import { State } from 'react-state-render-prop';const Example = () => {
return (
{(state, setState) => (
setState(state => state + 1)}>{state}
)}
);
};
```