-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't show modal on page load without opening event #33
Comments
could you please make a codesandbox :) |
sounds like your app is SSR? |
Yes, it's on next.js |
BUT, from 1st glance, sounds like in your case, you could just set the default of const { Portal, isOpen } = usePortal({
isOpen: true
}) |
BUT, from 1st glance, sounds like in your case, you could just set the default of const { Portal, isOpen } = usePortal({
isOpen: true
}) |
Nope, still same problem, |
btw, try restarting server on codesandbox if you don't see modal's html on first load |
Let me clarify what you're trying to do. You want also Are you making sure to pass the <button onClick={e => openSignInModal(e)}>Open Signin Modal</button> |
Yes, and yes I want it to be opened by default |
Did you find any fix? |
Not yet. Will take a look asap |
have this same issue with both my portals and it's driving me a little nuts. for clarification - it's not related to your package here @alex-cory, I had a homegrown Portal component and came here hoping that your package would resolve the issue, but alas it has not. Gonna continue to poke around and will share if I find a solution |
found a hack/work-around for nextjs users...utilizing...dynamic importing no it's not perfect but considering a lot of times portals are called asynchronously I think this is a halfway decent solution. const PureSlider = dynamic(
() => import('./pureSlider').then(mod => mod.PureSlider),
{
ssr: false,
}
); If anyone has a better solution or suggestion I'm all ears 🛩️ |
Whenever I want to show modal on render(make it visible without opening event) I get
Warning: Expected server HTML to contain a matching <div> in <div>.
My Code;
The text was updated successfully, but these errors were encountered: