├── index.js ├── .styleci.yml ├── .gitignore ├── .npmignore ├── .travis.yml ├── .flowconfig ├── tests ├── fixtures │ ├── InvalidFunctionalComponent.js │ ├── ValidFunctionalComponent.js │ ├── TestClassComponent.js │ ├── ValidClassComponent.js │ ├── injectFooHocFunctionalComponent.js │ ├── injectFooFactoryFunctionalComponent.js │ ├── TestFunctionalComponent.js │ ├── injectFooFactoryClassComponent.js │ └── injectFooHocClassComponent.js └── index.js ├── package.json ├── LICENSE ├── index.js.flow ├── README.md └── yarn.lock /index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | preset: psr2 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /xeno 3 | *.log -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /xeno 3 | /tests 4 | *.log -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: 4 | - 6.0 5 | 6 | sudo: false -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | .*/node_modules/ 3 | 4 | [lints] 5 | all=error 6 | 7 | [options] 8 | include_warnings=true 9 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectError 10 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectErrorTestClassComponent 11 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectErrorTestFunctionalComponent 12 | -------------------------------------------------------------------------------- /tests/fixtures/InvalidFunctionalComponent.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import * as React from 'react'; 3 | 4 | // This is an invalid functional component. HigherOrderComponents shouldn't accept this as input 5 | const InvalidFunctionalComponent = (props: {string1: string, number1: number}) => 'hi'; 6 | 7 | export default InvalidFunctionalComponent; -------------------------------------------------------------------------------- /tests/fixtures/ValidFunctionalComponent.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import * as React from 'react'; 3 | 4 | type Props = {string1: string, number1: number}; 5 | 6 | // This is a valid functional react component that we'll use to test our HigherOrderComponents later 7 | const ValidFunctionalComponent = (props: Props) =>
; 8 | 9 | export default ValidFunctionalComponent; 10 | -------------------------------------------------------------------------------- /tests/fixtures/TestClassComponent.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | import * as React from 'react'; 3 | 4 | export type Props = { 5 | foo: number, 6 | bar: number, 7 | baz: number, 8 | }; 9 | 10 | class TestClassComponent extends React.Component