i am using ionic-react and want to launch a modal popup when app is launched. The idea is to create a login popup when app starts. i will dismiss it if user is already logged in else user will login.
my current issue is how to open it automatically?
the way to open using button is known to me for code like below
<IonModal isOpen={loginModal} cssClass='my-custom-class'>
<p>This is modal content</p>
<IonButton onClick={() => setLoginModal(false)}>Close Modal</IonButton>
</IonModal>
<IonButton onClick={() => setLoginModal(true)}>Show Modal</IonButton>
but i don't need button.