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

后端 未结 8 1723
佛祖请我去吃肉
佛祖请我去吃肉 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条回答
  •  萌比男神i
    2020-12-24 10:52

    In my case the warning was like this;

    Require cycle: src\views\TeamVerification.js -> src\components\TeamVerificationListItem.js -> src\views\TeamVerification.js Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.

    As it indicates, TeamVerification was importing TeamVerificationListItem and TeamVerificationListItem was also importing TeamVerification. It was an unused import but after I remove it the warning gone.

提交回复
热议问题