Commit Graph

183 Commits

Author SHA1 Message Date
Andy
d8bab0f3be
More fixes from dtslint improvements (2) (#29799) 2018-10-17 12:59:50 -07:00
Ilker Güller
4464cbbfe7 react-navigation: Updated withNavigation HOC for suppressing prop requirement (#29208)
## Why?

Typescript requires assign of `navigation` on Component that is created with `withNavigation` HOC. But it comes with that function so it shouldn't require that property.

## Example

```typescript
//
// on the current version, this will give an error.
// with this PR, it will work.
//
interface IHelloProps extends Partial<NavigationInjectedProps> {
  hello: boolean;
}

const HelloBox: SFC<IHelloProps> = ({ navigation, hello }) => (
<View>
<TouchableHighlightCustom onPress={() => navigation.navigate('TEST', { hello })}>
        <Text>Hello</Text>
      </TouchableHighlightCustom>
</View>;
);

export default withNavigation(HelloBox);
```
----

Please fill in this template.

- [X] Use a meaningful title for the pull request. Include the name of the package modified.
- [X] Test the change in your own code. (Compile and run.)
- [x] Add or edit tests to reflect the change. (Run with `npm test`.)
- [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).
- [X] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).
- [X] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).

Select one of these and delete the others:

If adding a new definition:
- [ ] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration`
- [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
- [ ] Create it with `dts-gen --dt`, not by basing it on an existing project.
- [ ] `tslint.json` should be present, and `tsconfig.json` should have `noImplicitAny`, `noImplicitThis`, `strictNullChecks`, and `strictFunctionTypes` set to `true`.

If changing an existing definition:
- [ ] Provide a URL to documentation or source code which provides context for the suggested changes: <<url here>>
- [ ] Increase the version number in the header if appropriate.
- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ "extends": "dtslint/dt.json" }`.

If removing a declaration:
- [ ] If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
- [ ] Delete the package's directory.
- [ ] Add it to `notNeededPackages.json`.
2018-10-05 15:01:34 -07:00
Max Davidson
1ac3032b21
Improve HOC type inference 2018-09-27 14:03:43 +02:00
Dimitry
764a8a745c
Support params in generic withNavigation HOC 2018-09-24 10:26:34 +03:00
mickaelw
b59997949e Added type definitions for React Navigation (#28742) 2018-09-14 09:57:07 -07:00
Linus Unnebäck
074ace3372 react-navigation: Add params to state property (#28703) 2018-09-11 08:16:19 -07:00
Armando Aguirre
11ad4ef86e
Merge pull request #28233 from DenisFrezzato/master
[react-navigation] Fix navigationOptions type
2018-08-29 11:20:53 -07:00
DenisFrezzato
a3a71e170c Fix type of replace action. 2018-08-29 12:08:41 +02:00
Vincent Langlet
b5b41c82fa
Add tests 2018-08-27 12:16:35 +02:00
Vincent Langlet
692c76c786
Add static Height 2018-08-27 12:11:23 +02:00
DenisFrezzato
e8a0c4402e [react-navigation] Fix navigationOptions differences between createTabNavigator and createBottomTabNavigator. 2018-08-24 09:22:51 +02:00
Roberto Huertas
f5b87f3c5e fix(author): remove robertohuertasm from owners 2018-08-23 01:15:03 +02:00
Daniel Rosenwasser
2867d6a385
Merge pull request #28198 from taboulot/patch-5
[react-navigation] Update NavigationActions API v2
2018-08-22 13:28:48 -07:00
Daniel Rosenwasser
55b1bac6c4
Merge pull request #28093 from PatronGG/react-navigation-navigation-events
react-navigation: add NavigationEvents component
2018-08-22 13:02:08 -07:00
Clément
e7c35dc812
Update Test 2018-08-17 16:49:19 +02:00
Clément
d6fba2b95b
Update NavigationActions API v2 2018-08-17 16:43:27 +02:00
Benjamin Lichtman
9caa83c743
Merge pull request #27904 from LinusU/react-navigation-fallback
[react-navigation] Fix return type when fallback provided
2018-08-14 10:30:39 -07:00
Benjamin Lichtman
e49cd4aaf5
Merge pull request #28073 from MassiveMediaMatch/master
[react-navigation] Support for dispatching NavigationCompleteTransitionAction
2018-08-14 10:29:20 -07:00
Linus Unnebäck
b7887d9d66
[react-navigation] Remove robertohuertasm from authors 2018-08-14 14:27:18 +01:00
Linus Unnebäck
1021fbf970
Merge branch 'master' into react-navigation-fallback 2018-08-14 14:01:19 +01:00
Gustavo Brunoro
7b6c32205b react-navigation: add NavigationEvents component 2018-08-13 21:24:57 -03:00
LauR3y
983aa9cc64
Support for dispatching NavigationCompleteTransitionAction 2018-08-13 13:28:00 +02:00
hosomichi
6c3a8bf5ab
Merge branch 'master' into master 2018-08-09 10:57:12 +09:00
Linus Unnebäck
2e2da74160
Merge branch 'master' into react-navigation-fallback 2018-08-08 22:49:14 +01:00
Jake
69e3a50789 [@types/react-navigation] Added missing NavigationReplaceAction type variant to NavigationStackAction 2018-08-09 00:43:24 +08:00
seki
ce784479a0 [react-navigation] add exportation StackViewTransitionConfigs 2018-08-07 17:59:59 +09:00
Linus Unnebäck
965956065f
[react-navigation] Fix return type when fallback provided 2018-08-06 19:49:39 +01:00
Ferdy Budhidharma
bc0c933415 feat(react-dependents): update to TS 2.8 (part 2 of 2) (#27744)
* feat(react-dependents): update to ts 2.8

* fix version mismatches

* remove package.json

* post merge updates

* add package.json back again
2018-08-06 06:28:42 +01:00
Sergei Butko
6ddd9ea45d Add DrawerNavigationState (#27512) 2018-07-23 15:49:52 -07:00
Sergei Butko
dcd9338caa Add NavigationPushAction into NavigationStackAction type (#27511) 2018-07-23 12:23:18 -07:00
Omar Diab
1bac5b9a6c Fix onRef typings (ComponentType -> Component), generic for specificity (#27055)
* correct type for withNavigation onRef, add generic to access class methods

* tests for withNavigation class correctness

* tabbing

* remove generic, add explicit type suggestion
2018-07-13 13:08:26 -07:00
Ullrich Schäfer
35835aa275 [react-navigation] Adding support for parameters in NavigationInjectedProps (#27226)
* Adding a failing test for getParam

This demonstrates that typing of `navigation.getParam` works when a parameter type is provided.

This fails with the following error:

```
ERROR: 559:54  expect  TypeScript@next compile error:
Argument of type '"title"' is not assignable to parameter of type '"unknown"'.
```

* Making test pass
2018-07-12 09:30:10 -07:00
Jinesh Shah
eb868d6677 Fixed headerLeft and headerRight props (#26881)
* Update index.d.ts

Fixed headerLeft and headerRight types

* Update index.d.ts
2018-07-05 10:14:11 -07:00
Ullrich Schäfer
3c42098631 Adding correct injected props for withNavigationFocus 2018-06-28 14:36:27 +02:00
Ullrich Schäfer
455ab41dbb Adding a test that fails 2018-06-28 14:29:38 +02:00
C_Minor
223f4e532c Values added for event argument in addListener 2018-06-24 20:52:07 +02:00
Omar Diab
5ecba05510 update withNavigation types, add test 2018-06-21 16:01:41 -07:00
Kyle Roach
ca21971cc3 (react-navigation) Allow setParams to be partial 2018-06-18 05:14:44 -04:00
Mine Starks
6bd023659d
Merge pull request #26374 from dawnmist/react-navigation/fix-header-props
[react-navigation]: Add missing fields required for custom header use in v2.x.
2018-06-13 09:49:33 -07:00
Sergei Butko
f496c936e8
[react-navigation] Add DrawerActions 2018-06-12 20:55:26 +03:00
Janeene Beeforth
f4ee3156b3 Add missing fields required for custom header use in v2.x.
See https://github.com/react-navigation/react-navigation/issues/4286
2018-06-08 22:03:03 +10:00
Kyle Roach
45a5c62653 [react-navigation] Add index to NavigationLeafRoute 2018-06-05 20:02:01 -04:00
Stephen Bird
1923e12cb7 Add StackActions 2018-06-04 17:52:14 -07:00
Jérémy Magrin
79bd7180d0 Fix createMaterialTopNavigator to createMaterialTopTabNavigator 2018-06-02 13:28:26 +02:00
Jérémy Magrin
418b3b2691 Fix paths 2018-06-02 13:03:44 +02:00
Jérémy Magrin
e030f2b4de Fix dependencies 2018-06-02 13:00:09 +02:00
Jérémy Magrin
529312a91e Fix subfolder error 2018-06-02 12:51:10 +02:00
Andy
e5ba2b3ffd
react-navigation: Fix lint (#26205) 2018-06-01 09:27:58 -07:00
Jérémy Magrin
abf06b4f43 Try to fix dependencies 2018-05-21 12:32:59 +02:00
Jérémy Magrin
bc24e50bc1 Change type definition for v2 2018-05-21 11:53:22 +02:00