خرید بک لینک

Vote count: 0

I was reading this decorators and fount the @withViewPort usage as :

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

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

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

How does this work @withViewPort decorator work? Does it have state and these state changes while resizing the window size?

asked 44 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 5 خرداد 1395 ساعت: 14:17

صفحه بندی