Fetching contributors…
Cannot retrieve contributors at this time
32 lines (24 sloc) 582 Bytes


Use it for responsive design, renders only the first child that matches query against the current window width.


import {WindowWidthQuery} from 'libreact/lib/WindowWidthQuery';
import {View} from 'libreact/lib/View';

  <View maxWidth={300}>
    Up to 300px
    More than 300px

<WindowWidthQuery> is simply a shortcut for

<WindowSizeSensor>{({width}) =>
  <WidthQuery width={width}>
    {/* Your queries here... */}