1.2.3 • Published 8 years ago

@yomguithereal/react-utilities v1.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

react-utilities

Installation

npm i --save @yomguithereal/react-utilities

Usage

measured

Higher-order component that will wait to be mounted before rendering its target now provided with width & height information.

Will also re-render the target on window resize.

import measured from '@yomguithereal/react-utilities/measured';

const MeasuredComponent = measured({width: '100%', height: '50px', debounce: 300}, Component);

// Using as decorator
@measured({width: '100%'})
class {
  render() {
    return (...);
  }
}

Fetcher

The Fetcher component aims at wrapping another component in order to fetch some JSON data for him before rendering it.

This is mainly useful when prototyping viz components.

import Fetcher from '@yomguithereal/react-utilities/Fetcher';

class Wrapper extends Component {
  render() {
    return (
      <Fetcher url="/data.json" reducer={x => x}>
        <DataViz />
      </Fetcher>
    );
  }
}
1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago