faceyspacey / redux-first-router-link

<Link /> + <NavLink /> that mirror react-router's + a few additional props
MIT License
55 stars 33 forks source link

[flow.js] This package has more errors #117

Closed retyui closed 5 years ago

retyui commented 5 years ago

When a added this module to my project and then run command flow:

Errors $ flow Error -------------------------------------------------- ../node_modules/redux-first-router-link/dist/Link.js.flow:31:14 Cannot resolve name `object`. 31| routesMap: object ^^^^^^ Error ------------------------------------------------ ../node_modules/redux-first-router-link/dist/NavLink.js.flow:76:5 Cannot create `Link` element because property `dispatch` is missing in props [1] but exists in object type [2]. ../node_modules/redux-first-router-link/dist/NavLink.js.flow:76:5 v---- 76| -^ [1] References: ../node_modules/redux-first-router-link/dist/Link.js.flow:29:14 v 29| type Props = { 30| dispatch: Function, // eslint-disable-line flowtype/no-weak-types 31| routesMap: object 32| } & OwnProps ^ [2] Error -------------------------------------------- ../node_modules/redux-first-router-link/dist/handlePress.js.flow:7:32 Cannot use `SyntheticEvent` [1] without 0-2 type arguments. ../node_modules/redux-first-router-link/dist/handlePress.js.flow:7:32 7| export type OnClick = false | (SyntheticEvent => ?boolean) ^^^^^^^^^^^^^^ References: /tmp/flow/flowlib_627ddba/react-dom.js:123:29 123| declare class SyntheticEvent<+T: EventTarget = EventTarget, +E: Event = Event> { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] Error -------------------------------------------- ../node_modules/redux-first-router-link/dist/handlePress.js.flow:17:6 Cannot use `SyntheticEvent` [1] without 0-2 type arguments. ../node_modules/redux-first-router-link/dist/handlePress.js.flow:17:6 17| e: SyntheticEvent ^^^^^^^^^^^^^^ References: /tmp/flow/flowlib_627ddba/react-dom.js:123:29 123| declare class SyntheticEvent<+T: EventTarget = EventTarget, +E: Event = Event> { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] Error ------------------------------------------- ../node_modules/redux-first-router-link/dist/handlePress.js.flow:52:42 Cannot call `redirect` with `action` bound to `action` because: - null or undefined [1] is incompatible with `Action` [2]. - undefined [1] is incompatible with `Action` [2]. - array type [3] is incompatible with `Action` [2]. - string [3] is incompatible with `Action` [2]. ../node_modules/redux-first-router-link/dist/handlePress.js.flow:52:42 52| action = dispatchRedirect ? redirect(action) : action ^^^^^^ References: ../node_modules/redux-first-router-link/dist/handlePress.js.flow:15:8 15| to?: ?To, ^^^ [1] ../node_modules/redux-first-router/dist/action-creators/redirect.js.flow:5:25 5| export default (action: Action, type?: string, payload?: any) => { ^^^^^^ [2] ../node_modules/redux-first-router-link/dist/handlePress.js.flow:15:9 15| to?: ?To, ^^ [3] Error ----------------------------------------- ../node_modules/redux-first-router-link/dist/preventDefault.js.flow:3:20 Cannot use `SyntheticEvent` [1] without 0-2 type arguments. ../node_modules/redux-first-router-link/dist/preventDefault.js.flow:3:20 3| export default (e: SyntheticEvent) => ^^^^^^^^^^^^^^ References: /tmp/flow/flowlib_627ddba/react-dom.js:123:29 123| declare class SyntheticEvent<+T: EventTarget = EventTarget, +E: Event = Event> { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] Error ------------------------------------------------- ../node_modules/redux-first-router-link/dist/toUrl.js.flow:12:12 Cannot call `history().createHref` because property `createHref` is missing in `History` [1]. ../node_modules/redux-first-router-link/dist/toUrl.js.flow:12:12 v--------------------- 12| return history().createHref({ 13| pathname: to 14| }) -^ References: ../node_modules/redux-first-router/dist/flow-types.js.flow:82:41 82| createHistory?: (options?: Object) => History, ^^^^^^^ [1] Error ------------------------------------------------- ../node_modules/redux-first-router-link/dist/toUrl.js.flow:17:12 Cannot call `history().createHref` because property `createHref` is missing in `History` [1]. ../node_modules/redux-first-router-link/dist/toUrl.js.flow:17:12 v--------------------- 17| return history().createHref({ 18| pathname: path 19| }) -^ References: ../node_modules/redux-first-router/dist/flow-types.js.flow:82:41 82| createHistory?: (options?: Object) => History, ^^^^^^^ [1] Error ------------------------------------------------- ../node_modules/redux-first-router-link/dist/toUrl.js.flow:26:14 Cannot call `history().createHref` because property `createHref` is missing in `History` [1]. ../node_modules/redux-first-router-link/dist/toUrl.js.flow:26:14 v--------------------- 26| return history().createHref({ 27| pathname: path 28| }) -^ References: ../node_modules/redux-first-router/dist/flow-types.js.flow:82:41 82| createHistory?: (options?: Object) => History, ^^^^^^^ [1]
ScriptedAlchemy commented 5 years ago

If you have time to open a PR, otherwise ill try and get to it in the near future