Hi,
I’d like the DateTimePicker to show up on load.
I’m using React Typescript.
Hi,
I’d like the DateTimePicker to show up on load.
I’m using React Typescript.
Hi @Ilan_Levy,
Welcome to the Mobiscroll Forum! If you are using a functional approach in your code base, here’s an example on how to show the Datetime component on load:
import { Datetime, Input } from '@mobiscroll/react';
export function MyPage() {
const myRef = React.useRef<any>(null);
React.useEffect(() => {
if (myRef.current) {
myRef.current.instance.show();
}
});
return (<Datetime ref={myRef}>
<Input />
</Datetime>);
}
By the way, this is also applicable to any other Mobiscroll component, not only the Date & Time.
Let me know if you find this helpful!
Best,
Zoli