Xzayler
Explore posts from serversRedirect troubles
It's the classic use-case where I want a page to redirect if a user isn't logged in.
For some reason this doesn't work at all. The page will continue loading and error out because of trying to access properties of undefined.
It used to work a long while ago when I created this, and I have no idea when it broke.
As far as I can tell, this should work according to docs too.
So why is there no redirection happening?
9 replies
Dynamically rendering components
My objective in a nutshell is making a small user card appear on an element hover, like on twitter. The way I'm making it is the following:
This is a barebones representation
And then I have a wrapper for this popup With this method I get the error:
'use' router primitives can be only used inside a Route.
which I guess is because I'm trying to create UserPopup
just in the air without a parent, but I'm not sure how I should be creating UserPopup
within a context, or do I just have to not use useAction
and find something else? The other problem with this is I'm getting the warnings computations created outside a createRoot or render will never be disposed
. So I tried using both render and mount and attach the UserPopup element I create directly to the element I want it to go in but nothing happened, this was my attempt:
So what is the right way to do this?22 replies
Navigating with A from and to dynamic route doesn't re-render.
I have a dynamic route
routes/post/[postid].tsx
.
Within this route I have (simplified)
In dev, when I click on this a tag, the url updates in my browser but the dom doesn't, unless I force a reload. I'm guessing post
doesn't refetch or something. Do I need to force a refetch somehow or am I navigating wrong?46 replies