web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
657 stars 170 forks source link

Warning for require cycles #118

Closed KristianDikov closed 2 years ago

KristianDikov commented 2 years ago

Hi, every time when i run my RN App and these warnings are shown, please fix this issue. Early i used 0.5.1, now migrated to 0.7.0 but warnings are still there.


` WARN Require cycle: node_modules\react-native-paper-dates\src\Date\DatePickerModal.tsx -> node_modules\react-native-paper-dates\src\Date\DatePickerModalContent.tsx -> node_modules\react-native-paper-dates\src\Date\CalendarEdit.tsx -> node_modules\react-native-paper-dates\src\Date\DatePickerInput.tsx -> node_modules\react-native-paper-dates\src\Date\DatePickerModal.tsx

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. WARN Require cycle: node_modules\react-native-paper-dates\src\index.tsx -> node_modules\react-native-paper-dates\src\Date\DatePickerModal.tsx -> node_modules\react-native-paper-dates\src\Date\DatePickerModalContent.tsx -> node_modules\react-native-paper-dates\src\Date\CalendarEdit.tsx -> node_modules\react-native-paper-dates\src\Date\DatePickerInput.tsx -> node_modules\react-native-paper-dates\src\Date\inputUtils.ts -> node_modules\react-native-paper-dates\src\index.tsx

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. WARN Require cycle: node_modules\react-native-paper-dates\src\Time\TimePicker.tsx -> node_modules\react-native-paper-dates\src\Time\AnalogClock.tsx -> node_modules\react-native-paper-dates\src\Time\AnalogClockHours.tsx -> node_modules\react-native-paper-dates\src\Time\TimePicker.tsx

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. WARN Require cycle: node_modules\react-native-paper-dates\src\Time\TimePicker.tsx -> node_modules\react-native-paper-dates\src\Time\AnalogClock.tsx -> node_modules\react-native-paper-dates\src\Time\TimePicker.tsx

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. WARN Require cycle: node_modules\react-native-paper-dates\src\Time\TimePicker.tsx -> node_modules\react-native-paper-dates\src\Time\TimeInputs.tsx -> node_modules\react-native-paper-dates\src\Time\AmPmSwitcher.tsx -> node_modules\react-native-paper-dates\src\Time\TimePicker.tsx`

RichardLindhout commented 2 years ago

You can put this as temporary workaround in your App.tsx render,

import {
  LogBox,
} from 'react-native';

function App() {
    React.useEffect(() => {
        LogBox.ignoreLogs(['Require cycle']);
    }, []);

   return <....etc />

}
RichardLindhout commented 2 years ago

Fixed in next release!