#Link not updating instantly on click

9 messages · Page 1 of 1 (latest)

timber zinc
#

I have this navigation column with Links like this:

<Link prefetch={false} href={getHref()}>
  Click me
</Link>

Now when I click the Link i expect the url to change instantly but it doesnt. It is basically similar to this example (Right side where the Relevance links are):
https://commerce-v1.vercel.store/search/designers/next.js/featured?sort=trending-desc
There when I click on a Link it updates the url instantly which means I see the Loading skeleton.

So I am not sure if I have some sort of setup issue? Basically I am struggling to get the loading skeleton to show instantly on Click of a Link in my setup and I think it is because the URL is not being updated instantly.
Any help is appreciated 🙂

stone minnowBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

opaque horizon
#

Now when I click the Link i expect the url to change instantly but it doesnt.

@timber zinc What does this mean? Care to elaborate?

timber zinc
#

When I have a url like this /search/designers/next.js/featured?sort=trending-desc
And I click it, should the url in the browser bar be updated instantly?

#

or only change when the content is fully loaded?

#

whereby in my setup which is basically the same, does not seem to work that way

opaque horizon
#

Could you share the code of getHref()

timber zinc
#

Its very simple though

const getHref = () => {
    const root = `/applications`;

    if (state) {
      return `${root}?state=${state}`;
    }

    if (track) {
      return `${root}?tracks=${track}`;
    }

    if (score) {
      return `${root}?qs=${score}`;
    }

    return root;
  };