Closed ZwaarContrast closed 6 years ago
Using the example from the README with Flow:
// @flow import { routerForBrowser } from 'redux-little-router' const { reducer, middleware, enhancer } = routerForBrowser({ routes })
Results in Flow errors:
message: 'object literal (This type is incompatible with the expected param type of BrowserRouterArgs Property `basename` is incompatible:)'
message: 'object literal (This type is incompatible with the expected param type of BrowserRouterArgs Property `historyOptions` is incompatible:)'
message: 'object literal (This type is incompatible with the expected param type of BrowserRouterArgs Property `history` is incompatible:)'
I'm no flow expert, I just starting to use it, but if arguments are truly optional as they seem to be, shouldn't the type for BrowserRouterArgs be:
BrowserRouterArgs
type BrowserRouterArgs = { routes: Object, basename?: string, historyOptions?: BrowserHistoryOptions, history?: History };
instead of:
type BrowserRouterArgs = { routes: Object, basename: string, historyOptions: BrowserHistoryOptions, history: History };
+1, Just started with flow as well, and I've been having this same issue on a fresh project using:
Using the example from the README with Flow:
Results in Flow errors:
I'm no flow expert, I just starting to use it, but if arguments are truly optional as they seem to be, shouldn't the type for
BrowserRouterArgs
be:instead of: