1.0.2 • Published 5 years ago
react-adaptive-size v1.0.2
react-adaptive-size
A React.js hoc component that pass width infos to his wrapped component
Install
npm install --save react-adaptive-size
or
yarn add react-adaptive-size
Usage
import * as React from 'react';
import withAdaptiveSizes from 'react-adaptive-size';
class Example extends React.Component {
render() {
return (
<React.Fragment>
<div>Viewport width is: {this.props.viewportWidth}</div>
<div>Viewport size is: {this.props.viewportSize.name}</div>
</React.Fragment>
);
}
}
export default withAdaptiveSizes(Exemple);
License
MIT © aomati