diff --git a/src/index.tsx b/src/index.tsx index c1ec421..99534b5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -52,7 +52,7 @@ export class ContainerQuery extends React.Component { */ export function applyContainerQuery

( - Component: React.ComponentClass

, + Component: React.ComponentClass

| React.StatelessComponent

, query: Query, initialSize?: Size ): React.ComponentClass

{ diff --git a/test/client/index.js b/test/client/index.js index b2bd064..43b7bef 100644 --- a/test/client/index.js +++ b/test/client/index.js @@ -340,4 +340,20 @@ describe('applyContainerQuery', function () { }, 100); }); + it('accept stateless component', function (done) { + let _params; + + const Container = applyContainerQuery(function (props) { + _params = props.containerQuery; + return

; + }, query); + + render(, $div); + + setTimeout(() => { + expect(_params).toEqual({mobile: true, desktop: false}); + done(); + }, 100); + }); + });