Descope component cant be rendered conditionally, onReady should come from a hook and not as a callback from the component, instead of rendering a container with opacity 0 or 1 based on the loading we should be able to listen to changes and render the component.
reproduce:
{!isLoading && <Descope
flowId="sign-up-or-in-passwords-social-copy-new-demo"
onSuccess={handleSuccess}
onError={handleError}
onReady={onReady}
/>}
proposition:
const { isReady } = useDescope();
{isReady ? <Descope
flowId="sign-up-or-in-passwords-social-copy-new-demo"
onSuccess={handleSuccess}
onError={handleError}
onReady={onReady}
/> : <Loader/>}
and then render the component based on that, or maybe have a loader in the flow creator to style before the component is ready.
Thanks,
Descope component cant be rendered conditionally, onReady should come from a hook and not as a callback from the component, instead of rendering a container with opacity 0 or 1 based on the loading we should be able to listen to changes and render the component.
reproduce:
proposition:
and then render the component based on that, or maybe have a loader in the flow creator to style before the component is ready.
Thanks,