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

后端 未结 8 1712
佛祖请我去吃肉
佛祖请我去吃肉 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: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.

提交回复
热议问题