https://github.com/kriasoft/react-decorators
A collection of higher-order ReactJS components
https://github.com/kriasoft/react-decorators
Last synced: 6 months ago
JSON representation
A collection of higher-order ReactJS components
- Host: GitHub
- URL: https://github.com/kriasoft/react-decorators
- Owner: kriasoft
- License: mit
- Created: 2015-05-05T09:00:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-27T15:19:30.000Z (almost 10 years ago)
- Last Synced: 2025-06-19T19:03:49.502Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 229
- Watchers: 8
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# React Decorators
> A collection of higher-order React components
### How to Install
[](https://www.npmjs.org/package/react-decorators)
```shell
$ npm install react-decorators --save
```
### How to Use
```js
import React from 'react';
import withViewport from 'react-decorators/withViewport';
@withViewport
class MyComponent {
render() {
let { width, height } = this.props.viewport;
return
Viewport: {width + 'x' + height};
}
}
React.render(, document.body);
```
*More decorators coming soon...*
### Related Projects
- [React Starter Kit](https://github.com/kriasoft/react-starter-kit)
- [React Starter Kit Add-ons](https://github.com/kriasoft/react-starter-kit-addons)
- [React Style Guide](https://github.com/kriasoft/react-starter-kit/blob/master/docs/react-style-guide.md)
- [React Static Boilerplate](https://github.com/koistya/react-static-boilerplate)
### Copyright
The MIT License (c) Konstantin Tarkus ([@koistya](https://twitter.com/koistya)), Kriasoft LLC