You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Really love the simplicity of this component however I'm having an issue where the Modali modals flash on page refresh/component unmounting.
I have the modal toggles initialized to false and only update their state to true for certain actions however the modals are displaying for a split second on the pages/components just before a route change or transition to another page/component.
Here is the initialization of the modal with hooks:
{toggleUpgradeAccountModal&&(<Modali.Modal{...upgradeAccountModal}animated={true}centered={true}><divclassName="error-message"><divclassName="error-header"><Logo/><h3>Please upgrade your account.</h3></div><p>
Exporting to SCSS code is available to Hexy Pro
Unlimited and Hexy Pro Lifetime accounts.
<Linkto="/pro">Upgrade now</Link> to export SCSS.
</p><buttonclassName="button"><Linkto="/pro">Upgrade</Link></button></div></Modali.Modal>)}
This obviously shouldn't show unless toggleUpgradeAccountModal is set to true but for whatever reason, this must be getting toggled on the parent component unmount.
The only place this modal is set to true is in a handler deriving from an onClick action:
constexportCode=(palette,paletteName)=>{if(currentUser&&smallAccounts.indexOf(currentUser.accountType)===1){toggleUpgradeAccountModal(true)return}// rest of function code}
Thus I can't seem to find any other way the modal toggle is being set to true, yet the modal is still flashing on unmount.
Any ideas on why this is happening and how to fix?
The text was updated successfully, but these errors were encountered:
Hello,
Really love the simplicity of this component however I'm having an issue where the Modali modals flash on page refresh/component unmounting.
I have the modal toggles initialized to
false
and only update their state to true for certain actions however the modals are displaying for a split second on the pages/components just before a route change or transition to another page/component.Here is the initialization of the modal with hooks:
And here is an example modal:
This obviously shouldn't show unless
toggleUpgradeAccountModal
is set totrue
but for whatever reason, this must be getting toggled on the parent component unmount.The only place this modal is set to true is in a handler deriving from an
onClick
action:And then the
exportCode
handler:Thus I can't seem to find any other way the modal toggle is being set to true, yet the modal is still flashing on unmount.
Any ideas on why this is happening and how to fix?
The text was updated successfully, but these errors were encountered: