Conditionally rendering the Android date picker isn't working. If I set it to true it'll render the component straight up on load, but If I trigger from false to true on the render it doesn't show.
System:
OS: macOS 10.15.4
CPU: (4) x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
Memory: 945.49 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.16.2 - /usr/local/bin/node
Yarn: Not Found
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.7.0 - /usr/local/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 29
Build Tools: 29.0.3
System Images: android-23 | Google APIs ARM EABI v7a, android-25 | Intel x86 Atom, android-25 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_101 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz => 0.62.2
npmGlobalPackages:
react-native: Not Found
Library version: latest version
Describe what you expected to happen:
function DatePickerInput(props) {
const [date, setDate] = useState(new Date());
const [mode, setMode] = useState(props.mode);
const onChange = (selectedDate) => {
console.log(selectedDate);
const currentDate = selectedDate || date;
setDate(currentDate);
props.setDate(currentDate);
props.dismiss();
};
return (
value={date}
mode={mode}
display="default"
// isVisible={props.show}
onConfirm={onChange}
onCancel={props.dismiss}
/>
);
}
{showEffectiveDatePicker && (
setHoursChange({
...hoursChange,
effectiveDate: e,
});
}}
dismiss={() => setShowEffectiveDatePicker(false)}
mode="date"
show={showEffectiveDatePicker}
/>
)}
//showEffectiveDatePicker, when replaced with true renders the component, but not when it's set using state.
any update on this? i'm getting the same issue as well
Most helpful comment
any update on this? i'm getting the same issue as well