Commit Graph

21 Commits

Author SHA1 Message Date
Andy Hanson
45c9246c09 Remove esModuleInterop from tsconfigs (no longer mandatory) 2018-02-14 14:55:13 -08:00
Forbes Lindesay
8f8f6c4392 [react] Use HTMLDialogElement for the dialog node (#23053)
* [react] Use HTMLDialogElement for the dialog node

* Actually add the `open` property

* This update requires typescript 2.6

* Update dependents of react to also require typescript 2.6
2018-02-12 12:55:52 +00:00
Andy
bef4d2b27d Enable "esModuleInterop" in all tsconfigs (#23354) 2018-02-05 11:01:56 -08:00
Youen
2707abc38a [react-router] added possibility to specify component props in route definitions, and to specify the type of this.props.route.props when implementing such a component (#22954)
* [react-router] fixed lint error due to implicit any in CustomLink test

* [react-router] added possibility to specify component props in route definitions, and to specify the type of this.props.route.props when implementing such a component

Example:

/* component definition */
interface Props { foo: string }
class MyComponent extends React.Component<RouteComponentProps<void,void,Props>, State> {
    /* here you can use this.props.route.props.foo */
}

/* route configuration */
<Route path="/my-path" component={MyComponent} props={{ foo: 'bar' }}>

* - fixed lint errors related to T[] instead of Array<T>
- added default type for ComponentProps in RouteComponentProps<P,R,ComponentProps>, so that it stays compatible with existing code

* [react-router] added default route props type (any) so that this new feature is fully backward compatible

* [react-router] fixed lint errors (T[] instead of Array<T> for non-generic types)
2018-01-24 08:16:00 -08:00
Andy
947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
Andy
d74806eb3d Add lint disables for no-unnecessary-generics (#19508) 2017-09-01 08:34:37 -07:00
Andy
ba8e532a9c react-router/v3: Fix test (#19277) 2017-08-28 11:48:01 -07:00
Andy
516ed213ca Fix all lint errors (#19253) 2017-08-22 14:27:36 -07:00
Bowden Kelly
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
Andy
5d6c651a1a Apply stricter lint rules (#19063) 2017-08-17 14:53:41 -07: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
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
Mohamed Hegazy
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
Andy
5bf5228d71 Fix additional lint errors from the new dtslint (#15865) 2017-04-14 09:15:37 -07:00
Andy
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
Andy
68e0aea47a Lint additional react packages (#15527) 2017-03-30 14:25:38 -07:00
Andy Hanson
354cec620d Move all packages to a types directory 2017-03-24 14:27:52 -07:00