Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluating Component.propTypes #887

Closed
JulioOrellana opened this issue Dec 20, 2019 · 6 comments · Fixed by #1327
Closed

Evaluating Component.propTypes #887

JulioOrellana opened this issue Dec 20, 2019 · 6 comments · Fixed by #1327
Labels
Area: Gesture handlers This issue is related to problems with gesture handlers

Comments

@JulioOrellana
Copy link

Captura de Pantalla 2019-12-20 a la(s) 16 36 30

I am getting this error from upgrading from RN 0.59.10 to RN 0.61.5, I can't find the reason. Any clue?
Libs were unlinked and added to Pod

@dhevendhiran-adt
Copy link

hi,
I have the same issue. I am stuck in this same case (after upgraded to 0.61.5). Does anyone have any workarounds?

@JulioOrellana
Copy link
Author

JulioOrellana commented Dec 27, 2019

hi,
I have the same issue. I am stuck in this same case (after upgraded to 0.61.5). Does anyone have any workarounds?

The workaround I found on jest test is to mock every react-navigation library (or the ones you are actually using in your project).

jest.mock('react-navigation-stack', () => ({
  createStackNavigator: () => { },
  propTypes: {}
}));

jest.mock('react-navigation-tabs', () => ({
  createMaterialTopTabNavigator: () => { },
  createBottomTabNavigator: () => { },
  propTypes: {}
}));
...

@thassis
Copy link

thassis commented Jan 2, 2020

hi,
I don't use jest test, but I still have the same issue. Does you know another workarounds?
I already downgrade the react-native version to 0.61.0 from 0.61.5 and updated the react-native-gesture-handler and react-navigation to latest version, but nothing works.

@Gerlison
Copy link

Gerlison commented Jan 3, 2020

I've found a solution, aparently. I faced it when tried to update from RN@0.59.5 to RN@0.61.5.
To solve it:

  • update react-native-gesture-handler to latest
$ npm update react-native-gesture-handler@latest
  • update react-navigation to latest
$ npm update react-navigation@latest

To update them just follow the docs


Hope to help 😄

@99pdl
Copy link

99pdl commented Feb 6, 2020

I had the same issue and to workaround I simply put:

import React, { Component } from 'react';

at the very top of ./node_modules/react-native-gesture-handler/GestureHandler.js

Be aware that this is a temporary solution and I hope the package is fixed soon.

@duclahoang
Copy link

@99pdl you are my savior ! I was stuck with "react-native-gesture-handler" for 3 days.
Again, thank you so much <3

@jakub-gonet jakub-gonet added the Area: Gesture handlers This issue is related to problems with gesture handlers label Sep 3, 2020
jakub-gonet added a commit that referenced this issue Feb 8, 2021
## Description

This PR combines three others (#1273, #1280, #1291) and rewrites Gesture Handler and examples to TS.
We tried to make non-breaking changes but this should be tested.

Most types were overhauled, although they should remain compatible with old ones thanks to the type aliases in the `src/handlers/gestureHandlerTypesCompat.ts` file.

CI for iOS was disabled due to strange fails. It should be reenabled when we add unit/e2e tests to RNGH.

Fixes #1076 - removed Flow from DrawerLayout
Fixes #1261 - added TS types
Fixes #998 - regenerated example app
Fixes #887 - removed prop types

## Changes

### Package packing, configs & source code

- Swipeable and DrawerLayout are now resolved by their own `package.json`s
- React Native uses source code directly, browser and TS use files from `dist/`
- Removed prop types

#### Internal

- Removed unused babel config in the root dir, adjust Eslint config
- Removed unused functions
- Changed private names from `_name` to `private name`
- Replaced `x && x()` syntax with `x.?()`

### Types

- Added types compatibility layer for the new types (`gestureHandlerTypesCompat.ts`)
- Added generation of declarations and declarations map when TS is transpiled
- Moved types from declaration files to files with implementation
- Added types to Android / iOS / shared JS code
- Added basic types to the web version

### Example app

- Removed unused bits in examples
- Regenerated Example app with latest RN
- Removed stray files from examples/
- Updated Travis config to include newer Android build tools & iOS scheme name change
- Organized Example code structure
- Removed Example tests (they weren't testing anything)
- Reconfigured web version of examples

## Testing

PRs that were merged into `ts-rewrite` branch were tested by using `npm pack` and adding it to the new app. In the case of #1273 & #1280, we additionally checked bundled diff for changes.

We diffed master to generated dist/ directory using `diff --color -wryN -W 200 src/ dist/src`with imports removed by `find src -name "*.js" -type f -exec sed -i '' '/import/d' {} \;`

Co-authored-by: WoLewicki <wojciech.lewicki@swmansion.com>
Co-authored-by: Jakub <jakub.gonet@swmansion.com>
mrousavy pushed a commit to mrousavy/react-native-gesture-handler that referenced this issue Feb 11, 2021
This PR combines three others (software-mansion#1273, software-mansion#1280, software-mansion#1291) and rewrites Gesture Handler and examples to TS.
We tried to make non-breaking changes but this should be tested.

Most types were overhauled, although they should remain compatible with old ones thanks to the type aliases in the `src/handlers/gestureHandlerTypesCompat.ts` file.

CI for iOS was disabled due to strange fails. It should be reenabled when we add unit/e2e tests to RNGH.

Fixes software-mansion#1076 - removed Flow from DrawerLayout
Fixes software-mansion#1261 - added TS types
Fixes software-mansion#998 - regenerated example app
Fixes software-mansion#887 - removed prop types

- Swipeable and DrawerLayout are now resolved by their own `package.json`s
- React Native uses source code directly, browser and TS use files from `dist/`
- Removed prop types

- Removed unused babel config in the root dir, adjust Eslint config
- Removed unused functions
- Changed private names from `_name` to `private name`
- Replaced `x && x()` syntax with `x.?()`

- Added types compatibility layer for the new types (`gestureHandlerTypesCompat.ts`)
- Added generation of declarations and declarations map when TS is transpiled
- Moved types from declaration files to files with implementation
- Added types to Android / iOS / shared JS code
- Added basic types to the web version

- Removed unused bits in examples
- Regenerated Example app with latest RN
- Removed stray files from examples/
- Updated Travis config to include newer Android build tools & iOS scheme name change
- Organized Example code structure
- Removed Example tests (they weren't testing anything)
- Reconfigured web version of examples

PRs that were merged into `ts-rewrite` branch were tested by using `npm pack` and adding it to the new app. In the case of software-mansion#1273 & software-mansion#1280, we additionally checked bundled diff for changes.

We diffed master to generated dist/ directory using `diff --color -wryN -W 200 src/ dist/src`with imports removed by `find src -name "*.js" -type f -exec sed -i '' '/import/d' {} \;`

Co-authored-by: WoLewicki <wojciech.lewicki@swmansion.com>
Co-authored-by: Jakub <jakub.gonet@swmansion.com>
braincore pushed a commit to braincore/react-native-gesture-handler that referenced this issue Mar 4, 2021
## Description

This PR combines three others (software-mansion#1273, software-mansion#1280, software-mansion#1291) and rewrites Gesture Handler and examples to TS.
We tried to make non-breaking changes but this should be tested.

Most types were overhauled, although they should remain compatible with old ones thanks to the type aliases in the `src/handlers/gestureHandlerTypesCompat.ts` file.

CI for iOS was disabled due to strange fails. It should be reenabled when we add unit/e2e tests to RNGH.

Fixes software-mansion#1076 - removed Flow from DrawerLayout
Fixes software-mansion#1261 - added TS types
Fixes software-mansion#998 - regenerated example app
Fixes software-mansion#887 - removed prop types

## Changes

### Package packing, configs & source code

- Swipeable and DrawerLayout are now resolved by their own `package.json`s
- React Native uses source code directly, browser and TS use files from `dist/`
- Removed prop types

#### Internal

- Removed unused babel config in the root dir, adjust Eslint config
- Removed unused functions
- Changed private names from `_name` to `private name`
- Replaced `x && x()` syntax with `x.?()`

### Types

- Added types compatibility layer for the new types (`gestureHandlerTypesCompat.ts`)
- Added generation of declarations and declarations map when TS is transpiled
- Moved types from declaration files to files with implementation
- Added types to Android / iOS / shared JS code
- Added basic types to the web version

### Example app

- Removed unused bits in examples
- Regenerated Example app with latest RN
- Removed stray files from examples/
- Updated Travis config to include newer Android build tools & iOS scheme name change
- Organized Example code structure
- Removed Example tests (they weren't testing anything)
- Reconfigured web version of examples

## Testing

PRs that were merged into `ts-rewrite` branch were tested by using `npm pack` and adding it to the new app. In the case of software-mansion#1273 & software-mansion#1280, we additionally checked bundled diff for changes.

We diffed master to generated dist/ directory using `diff --color -wryN -W 200 src/ dist/src`with imports removed by `find src -name "*.js" -type f -exec sed -i '' '/import/d' {} \;`

Co-authored-by: WoLewicki <wojciech.lewicki@swmansion.com>
Co-authored-by: Jakub <jakub.gonet@swmansion.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Gesture handlers This issue is related to problems with gesture handlers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants