With new metro and RN 0.57, new warnings appear with Require cycle warnings.
Warning:
Require cycle: node_modules/react-native-gesture-handler/GestureHandler.js -> node_modules/react-native-gesture-handler/Swipeable.js -> node_modules/react-native-gesture-handler/GestureHandler.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
Where this happens:
Thanks for reporting @dsznajder we will look into it some time this week
@dsznajder @kmagiera It's not related to RNGH, but it's more Metro-related issue, will be sorted out if this issue will be resolved - https://github.com/facebook/metro/issues/287
Closed by #323
FYI, with v1.0.9 I'm still seeing some require cycle warnings:
Require cycle: node_modules/react-native-gesture-handler/index.js -> node_modules/react-native-gesture-handler/Swipeable.js -> node_modules/react-native-gesture-handler/index.js
require.js:109
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
Require cycle: node_modules/react-native-gesture-handler/index.js -> node_modules/react-native-gesture-handler/DrawerLayout.js -> node_modules/react-native-gesture-handler/index.js
require.js:109
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle
@kmagiera Should I reopen this issue to track those leave it to metro?
Facing the same issue here too. I have not found a working solution yet.
Yes. I'm reopening this issue. We should perhaps change imports in DrawerLayout and Swipeable to load from ./GestureHandler module instead of using react-native-gesture-handler. Anyone would like to submit a PR?
I hope I will find time this week and do it :)
If someone would like to handle this, just take it.
Any chance we could get a patch release to fix this? 馃槃
Just published 1.0.10 -> https://github.com/kmagiera/react-native-gesture-handler/releases/tag/1.0.10
Thanks @kmagiera!
Hey guys! I'm still seeing the warnings on 1.0.12.
Me too. Using RNGH-1.0.12, RN-0.57.8
In DrawerLayout.js, I see:
import {
PanGestureHandler,
TapGestureHandler,
State,
} from 'react-native-gesture-handler';
So it looks like something reverted the change there...
Changing the import code in DrawerLayout.js back to:
import {
PanGestureHandler,
TapGestureHandler,
State,
} from './GestureHandler';
resolves the problem
This commit actually reverted the changes for the import ... https://github.com/kmagiera/react-native-gesture-handler/commit/48b66807c3577b99859f9aee9394105cf722f535
@brentvatne @kmagiera Can you guys check the import regression ?
Most helpful comment
Changing the import code in DrawerLayout.js back to:
resolves the problem