1.0.0 • Published 6 years ago
react-side-channel v1.0.0
React-Side-Channel 🌒
Render something aside, and reuse in main component tree
This is more or less about keeping the react render "tree" clean
API
SideChannel with following props
initial
- initial valuerender
- something with input, and output.onChange
- data update callbackchildren
- in form of renderprop, to be givven output.
The goal of the library - put aside render
, and pipe output
to children
, no matter how deep it is.
import {SideChannel} from 'react-side-channel';
<SideChannel
initial={0}
render={ ({input, output}) => <Value initial={input}>{output}</Value> }
>
({value, set}) => (
<div>{value}</div>
)}
</SideChannel>
Licence
MIT
1.0.0
6 years ago