page-wrapper
some common methods for template pages
Installation
$ npm install --save @canner/page-wrapper
Usage
const wrapper = require('@canner/page-wrapper');
class PageInner extends Component {
static propTypes = {
foo: PropTypes.string
};
render() {
const {foo} = this.props;
return (
<div>
inner, value foo: {foo}
</div>
);
}
}
const PageInnerWrapper = wrapper()(PageInner);
// or decorator method
@wrapper
class PageInner extends Component {
static propTypes = {
foo: PropTypes.string
};
render() {
const {foo} = this.props;
return (
<div>
inner, value foo: {foo}
</div>
);
}
}
Usage
This library is really small, look into source code. see src/index.js
for details.
Start example server
node devServer.js
License
Apache-2.0 © chilijung