An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# React Decorators

> A collection of higher-order React components

### How to Install

[![npm/react-decorators](https://nodei.co/npm/react-decorators.png?compact=true)](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