proppy-preact
Preact integration package for ProppyJS
Guide
Installation
With npm:
$ npm install --save proppy preact proppy-preact
Via unpkg CDN:
Usage
First, setup your root component with providers data:
// components/Root.js;; ; const providers = foo: 'foo value'; { return <ProppyProvider providers=providers> <MyComponent /> </ProppyProvider> ;}
Now anywhere from your components tree, you can use the attach
higher-order component:
// components/MyComponent.js;;; const P = ; { const foo bar = props; return <p></p>;} PMyComponent;
API
ProppyProvider
For setting providers at Preact's context-level.
Example:
;; { return <ProppyProvider providers=providers> <SomeOtherComponent /> </ProppyProvider> ;}
attach
attach(P)(Component)
Higher-order component for attaching your Proppy factory to your Component.