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

Require cycle warnings with React Native 0.57.0 #3282

Closed
thedjinn opened this issue Sep 20, 2018 · 4 comments
Closed

Require cycle warnings with React Native 0.57.0 #3282

thedjinn opened this issue Sep 20, 2018 · 4 comments
Assignees

Comments

@thedjinn
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.1
  • react v16.5.0
  • react-native v0.57.0

Actual behaviour

When importing react-native-router-flux in my React Native 0.57 project I get 4 warnings about require cycles. It's working fine but these log messages are spammy because they reappear during (hot) reloading.

2018-09-20 14:08:18.565 [warn][tid:com.facebook.react.JavaScript] Require cycle: node_modules/react-native-router-flux/src/navigationStore.js -> node_modules/react-native-router-flux/src/Reducer.js -> node_modules/react-native-router-flux/src/navigationStore.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

2018-09-20 14:08:18.564752+0200 RedactedAppName[52778:12799768] Require cycle: node_modules/react-native-router-flux/src/navigationStore.js -> node_modules/react-native-router-flux/src/Reducer.js -> node_modules/react-native-router-flux/src/navigationStore.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

2018-09-20 14:08:18.566 [warn][tid:com.facebook.react.JavaScript] Require cycle: node_modules/react-native-router-flux/src/navigationStore.js -> node_modules/react-native-router-flux/src/NavBar.js -> node_modules/react-native-router-flux/src/navigationStore.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

2018-09-20 14:08:18.566431+0200 RedactedAppName[52778:12799768] Require cycle: node_modules/react-native-router-flux/src/navigationStore.js -> node_modules/react-native-router-flux/src/NavBar.js -> node_modules/react-native-router-flux/src/navigationStore.js
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

Steps to reproduce

Use React Native 0.57 and import the react-native-router-flux package:

import {
    Router,
    Stack,
    Scene,
    Actions,
    Drawer
} from "react-native-router-flux";
@daviscabral daviscabral self-assigned this Sep 23, 2018
@GunnarAK
Copy link

GunnarAK commented Sep 24, 2018

I am getting the same warnings on RN 57 with my own screen components.
Versions
"react": "16.5",
"react-native": "0.57.0",

Require cycle: js/components/index.js -> js/components/HomeScreen.js -> js/componentes/index.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

Stack:

metroRequire
<unknown>
loadModuleImplementation
guardedLoadModule
<unknown>
loadModuleImplementation
guardedLoadModule
metroRequire
<unknown>
loadModuleImplementation

@ramibaraka
Copy link

ramibaraka commented Sep 24, 2018

@aksonov Pls bump the React-navigation version. The latest version depends on a newer version of react-native-safe-area-view with this issue fixed

@aksonov
Copy link
Owner

aksonov commented Sep 24, 2018

@thedjinn I removed cyclic dependency for NavBar. Please check updated examples/react-native. If it works for you, you may use current master.

@aksonov
Copy link
Owner

aksonov commented Sep 24, 2018

Should be solved within master, will release shortly

@aksonov aksonov closed this as completed Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants