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

后端 未结 8 1706
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 10:12

I am receiving this warning message in my chrome console for my react-native project. Do you have any idea why I am getting this?

This is the complete message:

相关标签:
8条回答
  • 2020-12-24 11:10

    Please check whether you have imported same details within that file. (i.e)

    your file being as a actions/meals.js and you have added the line in the same file like

    import { Something } from './actions/meals.js'

    0 讨论(0)
  • 2020-12-24 11:15

    Some imports cause this warning if they're done through the require keyword. Replace these with import statements and you will be good to go. For example,

    const abc = require("example"); // Don't use this syntax
    import abc from "example"       // Use this syntax instead
    

    NOTE: This might vary from project to project. For a detailed understanding of require vs import, refer to this link.

    0 讨论(0)
提交回复
热议问题