Skip to content

Add back `applyContainerQuery`.

Compare
Choose a tag to compare
@d6u d6u released this 14 Jan 22:51
· 72 commits to master since this release

Now below should work just like pre 0.7.x

class MyComponent extends Component {
  render() {
    return (
      <div className={classnames('container', this.props.containerQuery)}>
        <div className='box'>the box</div>
      </div>
    );
  }
}

const query = {
  'width-between-400-and-599': {
    minWidth: 400,
    maxWidth: 599
  },
  'width-larger-than-600': {
    minWidth: 600,
  }
};

const HigherOrderComponent = applyContainerQuery(MyComponent, query);