Commit Graph
45 Commits
Author SHA1 Message Date
AndyandGitHub ccdb9e03d1 Add tslint disables for no-unnecessary-generics (#19564) 2017-09-05 09:14:04 -07:00
AndyandGitHub d74806eb3d Add lint disables for no-unnecessary-generics (#19508) 2017-09-01 08:34:37 -07:00
AndyandGitHub ba8e532a9c react-router/v3: Fix test (#19277) 2017-08-28 11:48:01 -07:00
AndyandGitHub 516ed213ca Fix all lint errors (#19253) 2017-08-22 14:27:36 -07:00
Bowden KellyandGitHub 6ed0a5a845 Merge pull request #18616 from ssorallen/v3-react-router-with-router
Type and export props from react-router's `withRouter`
2017-08-22 13:18:48 -07:00
AndyandGitHub 924fafffc0 Fix remaining lint errors (#19166) 2017-08-20 15:37:53 -07:00
AndyandGitHub 5d6c651a1a Apply stricter lint rules (#19063) 2017-08-17 14:53:41 -07:00
Egor Shulga b51a8da34b Add dtslint type assertion test. 2017-08-11 17:44:07 +03:00
Egor Shulga aa596d8723 Move decorator signature comment to the top of the line. 2017-08-11 17:22:56 +03:00
Egor Shulga 1d8a7055cf add withRouter decorator 2017-08-09 15:03:53 +03:00
Ross Allen 9a1aa8923c Move author attribution to v3 version, not v4 2017-08-04 17:44:56 -07:00
Ross Allen 6d09e851c9 Add detailed react-router withRouter example 2017-08-03 17:52:18 -07:00
Ross Allen 4023dce879 Type and export props from withRouter
In react-router v3.0.5, [`withRouter`][0] passes 4 props to the wrapped
component: `location`, `params`, `router`, and `routes`. These props are
different than those passed to `Route` components; these all come
directly from the Router either via `this.props` or `this.context`.

The component passed to `withRouter` are passed these props, but the
component returned from `withRouter` require only the component's own
props.

[0]: https://github.com/ReactTraining/react-router/blob/v3.0.5/modules/withRouter.js#L40
2017-08-03 16:49:26 -07:00
Stéphane Goetz a24aee6125 Improve react typings for HTML attributes, fix tests in other libraries 2017-07-10 22:43:07 +02:00
Ryan CavanaughandGitHub fec422d226 Merge pull request #17611 from tkrotoff/react-router-component
Refactoring: use React.ComponentType
2017-07-10 09:41:41 -07:00
mtpcandMtpc bc710a72d6 Make Route component extensible
Shouldn't have any impact whatsoever in existing codebases due to default generics
2017-07-04 21:17:49 +02:00
Tanguy Krotoff 552051f56f Default props should be {}, not undefined or void 2017-06-29 14:00:18 +02:00
Tanguy Krotoff 51e7287c86 React.SFC<...> | React.ComponentClass<...> => React.ComponentType<...> 2017-06-29 14:00:00 +02:00
Tanguy Krotoff 13a594f24e Move the official examples to directory examples-from-react-router-website 2017-06-28 03:03:42 +02:00
Tanguy Krotoff b6cc600508 null! => null thanks to PR #17021 2017-06-28 02:23:02 +02:00
Tanguy Krotoff 573083a518 Replace React.Component<(any|void|\{\}|null)> by React.Component
+ many manual adjustments
2017-06-21 09:48:37 +02:00
Tanguy Krotoff ea9de8a518 Replace React.Component<(.*), (any|void|\{\}|null)> by React.Component<$1>
+ many manual adjustments
2017-06-19 13:35:50 +02:00
Tanguy Krotoff eeb262e1d8 Update react to TypeScript 2.3 2017-06-19 13:34:54 +02:00
Nathan Shively-Sanders 4874667de9 Fix primitive weak type errors
These weak type errors were not caught in TS 2.4 RC. The final TS 2.4
will catch weak type errors with primitives, so this PR fixes those
now-caught errors.
2017-06-15 11:46:46 -07:00
Michael StrobelandMohamed Hegazy 3b1ba96df2 [react-router] add RouteComponentProps.staticContext (#16812)
* [react-router] add RouteComponentProps.staticContext

* [react-router] revert RouteConfig test file

* [react-router] Add example for StaticRouter and staticContext
2017-05-31 21:56:38 -07:00
Daniel Rosenwasser 3b8b7625b7 Lints. 2017-05-30 01:17:26 -07:00
Daniel Rosenwasser 65cfdaef94 Fixed the type of 'children' for 'Route' in 'react-router'. 2017-05-30 01:01:22 -07:00
Daniel Rosenwasser 4e4890ccc8 Added tests for 'children' set to both elements and functions to elements in 'react-router'. 2017-05-30 00:58:35 -07:00
YuiandMohamed Hegazy 1d19461b6e Update state type parameter (#16361) 2017-05-05 16:36:51 -07:00
DaIgebandMohamed Hegazy fe1b612ef0 Allow component props for withRouter (#16339) 2017-05-05 10:38:55 -07:00
DaIgebandMohamed Hegazy 585178525c Update SwitchProps to support typescript 2.3 (#16340)
SwitchProps.children is too strict for projects using typescript 2.3.
With typescript 2.3 the children could be made mandatory, but this will
break backwards compatibility with any ts 2.2 user
2017-05-05 10:11:16 -07:00
Kanchalai Tanglertsampan eeff64b04e Update library files with children check 2017-05-04 16:31:27 -07:00
Mohamed HegazyandGitHub e564537f7f Fix lint failures (#16329)
* fix lint failures

* Fix more lint failures

* Fix some more lint errors
2017-05-04 15:31:42 -07:00
DenisandMohamed Hegazy ddb6d939c3 TS Linting react-router (#16240)
- Using default `dtslint/dt.json` for linting
2017-05-01 13:47:36 -07:00
Jeremy FauvelandSheetal Nandi cb42760188 Add missing Redirect props (#16195)
Add an optional extended description…
2017-04-28 10:54:07 -07:00
AndyandGitHub 5bf5228d71 Fix additional lint errors from the new dtslint (#15865) 2017-04-14 09:15:37 -07:00
AndyandGitHub bbc61fbf93 Extend "dtslint/dt.json" directly instead of "../tslint.json". (#15822)
* Extend "dtslint/dt.json" directly instead of "../tslint.json".

* Convert more "../tslint.json" to "dtslint/dt.json"

* no-redundant-modifiers -> strict-export-declare-modifiers
2017-04-14 08:04:05 -07:00
Nathan Shively-SandersandGitHub f4ce20f619 Merge pull request #15403 from kryops/react-router4
react-router MemoryRouter.initialEntries can be string[]
2017-04-06 09:03:33 -07:00
AndyandGitHub 68e0aea47a Lint additional react packages (#15527) 2017-03-30 14:25:38 -07:00
AndyandGitHub 5f3ba45136 Use dtslint (#15482) 2017-03-29 13:07:39 -07:00
Michael Strobel 4a2542e4af react-router MemoryRouter.initialEntries
* Use History.LocationDescriptor[]
* Add example
2017-03-29 08:07:50 +08:00
Huy Nguyen 7da5a5871f Update contributor credits 2017-03-28 14:02:24 -04:00
Huy Nguyen 3e626b8949 Add type of context for react-router & react-router-dom
The `Router` component passes a context object down to children.  This
commit adds the type definition for this context object for children of
`Router` to use.
2017-03-28 13:57:16 -04:00
Budry e77796aee3 StaticRouter has no any history props 2017-03-24 23:59:28 +01:00
Andy Hanson 354cec620d Move all packages to a types directory 2017-03-24 14:27:52 -07:00