1.0.0 • Published 6 years ago

react-side-channel v1.0.0

Weekly downloads
5
License
-
Repository
-
Last release
6 years ago

React-Side-Channel 🌒

Render something aside, and reuse in main component tree

NPM version

This is more or less about keeping the react render "tree" clean

API

  • SideChannel with following props

    • initial - initial value
    • render - something with input, and output.
    • onChange - data update callback
    • children - 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