MoKhajavi75 / react-native-jalali-datepicker

📅 React Native Jalali DatePicker component for both Android and iOS ✨
MIT License
82 stars 4 forks source link

Require Cycle warning #5

Closed aminmeshk closed 3 years ago

aminmeshk commented 3 years ago

Every time the app renders the date picker, it gives the warning below (in the console) in React Native v0.63 and I think there should be an easy fix for it:

Require cycle: node_modules\@mohamadkh75\react-native-jalali-datepicker\src\components\index.js -> node_modules\@mohamadkh75\react-native-jalali-datepicker\src\components\YearSelector.js -> node_modules\@mohamadkh75\react-native-jalali-datepicker\src\components\index.js

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

Oh and also it gives the same warning but for utils.js, Calendar.js and MonthSelector.js. (For example: index.js > Calendar.js > index.js) They all are using index.js but they shouldn't.

aminmeshk commented 3 years ago

I fixed it and created a pull request: #6 :)