Skip to content

kriasoft/react-decorators

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3f430ab · Jun 18, 2015

History

18 Commits
Jun 18, 2015
Jun 18, 2015
Apr 28, 2015
Apr 28, 2015
Jun 18, 2015
Jun 18, 2015
Jun 18, 2015
Jun 18, 2015
Jun 18, 2015
Jun 18, 2015
Jun 18, 2015

Repository files navigation

React Decorators

A collection of higher-order React components

How to Install

npm/react-decorators

$ npm install react-decorators --save

How to Use

import React from 'react';
import withViewport from 'react-decorators/withViewport';

@withViewport
class MyComponent {
  render() {
    let { width, height } = this.props.viewport;
    return <div>Viewport: {width + 'x' + height}</div>;
  }
}

React.render(<MyComponent />, document.body);

More decorators coming soon...

Related Projects

Copyright

The MIT License (c) Konstantin Tarkus (@koistya), Kriasoft LLC