Commit Graph

71 Commits

Author SHA1 Message Date
bill-improbableio
2fa8371b3c react-redux: Fix permissive decoration props not handled correctly (#27260)
* Bump ts version to fix failing tests

* Fix optional props not merged correctly

* Bump version

* Correct the fix

* Add test for more-general injected props
2018-07-23 10:17:58 -07:00
Oliver Joseph Ash
5e54cc92a7 react-redux: use Exclude in Omit (#27019)
The legacy definition doesn't work with TypeScript 2.9.

Fixes https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26510
2018-07-09 14:24:48 -07:00
Olegs Jeremejevs
c79c53115b react-redux: Add defaults to new type parameters 2018-06-23 18:52:18 +03:00
Olegs Jeremejevs
a0f9774a4d react-redux: Remove ReactNode import 2018-06-07 21:57:10 +03:00
Olegs Jeremejevs
c5521e38a9 react-redux: Fix Provider typing problem discussed in #25321, clean up a bit 2018-06-07 21:50:21 +03:00
Armando Aguirre
b21fbc2d15
Merge pull request #26157 from MikeBall0/patch-1
Fix for issue #25343 @types/react-redux
2018-06-04 18:01:11 -07:00
MikeBall0
34ff751d06
Fix for issue 25343
Including `& TOwnProps` in `TInjectedProps` for `InferableComponentEnhancerWithProps` causes the `TOwnProps` to need to exist in the extended component, when really those props are defined by the `mapStateToProps`.
2018-05-30 20:59:20 +00:00
waterfoul
57cb3558e2 Fixed the typings for inferred types with functional components 2018-05-18 09:30:11 -05:00
Thomas Charlat
65b176eaef [react-redux]: decoration target props should not extend injected props, contravariance issue (#25228)
* feat(react-redux): add strict null check

* feat(react-redux): remove improper inference tests

Infered decorated typings would rely on the implicit and false
assumption that decorated component props extend injected props and
own props

#24922
#24913

* fix(react-redux): injected props and decorated component props intersection

* InjectedProps should not have to extend DecoratedProps
* DecoratedProps should not have to extend InjectedProps
* DecoratedProps should extend Intersection<InjectedProps, DecoratedProps>
* Remaining Props should be required on the decoration output

#24913
#24922

* feat(react-redux): add new commiters

* feat(react-redux): 2.9 keyof compatibility depends on Extract (2.8)
2018-05-07 12:34:04 -07:00
ryym
908da1fb1d [react-redux] Update for redux@4.0.0 (retry) (#25435)
* [react-redux] Copy current files to v5 sub directory

* [react-redux] Fix v5 tsconfig

* [react-redux] Increase the react-redux version in header comment

* [react-redux] Update type defenitions for redux@4.0.0
2018-05-07 11:30:42 -07:00
ryym
5ca461cbd3 Revert "[react-redux] Update type definitions for redux@4.0.0 (#25109)" (#25367)
This reverts commit 1efe02587a.
2018-04-27 08:50:30 -07:00
Ron Buckton
b73b4426dd compatibility fix for keyof T in ts 2.9 2018-04-24 19:48:14 -07:00
ryym
1efe02587a [react-redux] Update type definitions for redux@4.0.0 (#25109) 2018-04-24 17:08:19 -07:00
Rasmus Eneman
bf0dd39818 Improve type inference of react-redux (#24764) 2018-04-09 16:23:25 -07:00
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
Karlis Gangis
77a37a7fab react-redux: fix Options generic type arguments in connect() 2017-11-25 22:07:37 +02:00
Oliver Joseph Ash
000a9bfcda Move state generic to last position and improve tests 2017-11-10 20:50:34 +00:00
Oliver Joseph Ash
873eb12c02 react-redux: add generic for state parameter 2017-11-10 10:51:55 +00:00
pdeva
f6f55fae83 Update index.d.ts for react-redux (#20848)
* Update index.d.ts for react-redux

known issue described in comments

* minor

* update
2017-10-27 17:02:34 -07:00
Andy
19f89399e4 Ensure every package has a tslint.json (#21009)
* Ensure every package has a tslint.json

* Fixes
2017-10-25 11:13:50 -07:00
Andy
947a8fb761 Enable strictFunctionTypes (#20373) 2017-10-06 14:03:03 -07:00
Nathan Shively-Sanders
b8ea87c68e Strict function variance fixes round 1 2017-10-02 15:50:34 -07:00
Dibyo Majumdar
2717cfa52c [react-redux] Add createProvider (#20052)
* Add ConnectFunction interface

* Add createProvider function declaration

* Add documentation for createProvider

* Update documentation for Connect

* Add new author

* Add test for createProvider
2017-10-02 13:10:11 -07:00
Arthur Ozga
e1bd6ce33a Merge pull request #19666 from NicholasBoll/fix/react-redux-map-factories
[react-redux] Fix map factories
2017-09-14 15:31:56 -07:00
Arthur Ozga
0c29ad74db Merge pull request #19654 from zspitz/activex-libreoffice
activex-libreoffice: initial commit
2017-09-14 14:06:43 -07:00
Arthur Ozga
f1ecd79635 Merge pull request #19672 from alecmerdler/react-redux-wrappedcomponent
[react-redux] Add missing WrappedComponent
2017-09-14 13:01:26 -07:00
Alec Merdler
5e673b9dfa added test for WrappedComponent 2017-09-12 10:51:51 -04:00
Alec Merdler
556d60bc17 added WrappedComponent to return type of InferableComponentEnhancerWithProps 2017-09-11 10:29:58 -04:00
Nicholas Boll
1cc622c196 [react-redux] Updated version 2017-09-11 00:32:24 -06:00
Nicholas Boll
23d6b6b42c [react-redux] Added contributor 2017-09-11 00:26:57 -06:00
Nicholas Boll
f1dce7be19 [react-redux] Fix map factories
* Changed the order of factory vs object in mapping functions so TS picks the right one
* Added test cases and test style
2017-09-11 00:21:31 -06:00
Zev Spitz
aa32efdbad Merge branch 'master' into activex-libreoffice 2017-09-11 08:19:51 +03:00
Zev Spitz
4319f2ed28 Merge upstream changes (#3) 2017-09-10 08:44:56 +03:00
Frank Tan
e8222e83c4 Revert "Merge pull request #19378 from tansongyang/master"
This reverts commit a7dcec2bb2, reversing
changes made to f4711be54c.
2017-09-09 14:53:11 -04:00
Nathan Shively-Sanders
a7dcec2bb2 Merge pull request #19378 from tansongyang/master
[react-redux] Give `connect` default types
2017-09-05 16:00:40 -07:00
Andy
0537c1fb27 Add "private": true to every package.json (#19483) 2017-08-31 08:02:56 -07:00
Frank Tan
5677208b59 [react-redux] Fix incorrect change in connect.
Accidentally removed {} in 3rd generic position and turned this into a 3-arity version vs the original 4-arity.
2017-08-29 11:28:29 -04:00
Frank Tan
15e604f2f3 [react-redux] Make connect input types optional
For convenience.
2017-08-27 16:11:16 -04:00
Sean Kelley
1e00ae550b Remove myself as maintainer of react-redux (again).
#18801
2017-08-22 12:35:57 -07:00
Marco Buono
b7486f2c4d react-redux: fix dispatchToProps as object
This fixes the resulting wrapped component type returned by
the connect HOC when the `dispatchToProps` argument is an object. (Fixes
issue #18955)

Previously we were using `MapDispatchToPropsObject` but that doesn't
work with `Omit<T, K>`, so dispatch props were being preserved on the
resulting object. I've replaced that with `TDispatchProps` instead.

I've added test code by @horiuchi, adapted from:
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18955
2017-08-18 21:06:54 -03:00
Daniel Rosenwasser
b71c0e48ac Merge pull request #18984 from coreh/patch-1
react-redux: Make dispatch property optional in DispatchProp<S>
2017-08-16 13:25:05 -07:00
Daniel Rosenwasser
0e9358b5b2 Merge pull request #18951 from dannycochran/patch-7
update react-redux connect options
2017-08-16 11:00:44 -07:00
Danny Cochran
d38522bd72 make default arguments {} instead of any 2017-08-15 12:47:50 -07:00
Marco Buono
53266428eb react-redux: Add test for optional dispatch prop 2017-08-15 14:53:42 -03:00
Marco Aurélio
b68c87fee6 react-redux: Make dispatch property optional
That way the function returned by `connect()` (when no `mapDispatchToProps` function is specified) can also take React classes that don't have a `dispatch` prop declared. (But we get to keep the type checking for the classes that do)
2017-08-15 12:53:34 -03:00
Danny Cochran
2da9431df1 Make all arguments for Options optional
next-redux-wrapper uses Options -- a separate PR can add arguments there.
2017-08-15 07:47:06 -07:00
Frank Tan
eaea12959d [react-redux] Do not mark ownProps as optional
According to docs, "it's always legal to provide a callback that accepts fewer arguments": https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#optional-parameters-in-callbacks

Morever, react-redux docs say that ownProps will have a value when it is specified as a callback argument: https://github.com/reactjs/react-redux/blob/master/docs/api.md#the-arity-of-mapstatetoprops-and-mapdispatchtoprops-determines-whether-they-receive-ownprops
2017-08-15 10:13:01 -04:00
Danny Cochran
3342c4d879 remove trailing white space 2017-08-14 17:55:53 -07:00