A React.js hoc component that pass width infos to his wrapped component
npm install --save react-adaptive-size
or
yarn add react-adaptive-size
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);
MIT © aomati