Jatin Hemnani
Jatin Hemnani

Reputation: 321

Access parameter without load function in svelte kit

In SvelteKit, I want to access page.params without using the SSR load function because I want to have client side rendering only. Is there any way to access page.params without the SSR load function?

Upvotes: 7

Views: 2409

Answers (1)

Jatin Hemnani
Jatin Hemnani

Reputation: 321

I got the solution.

import { page } from "$app/stores";
const { slug } = $page.params;

and in this way I got the params without the load function.

Upvotes: 15

Related Questions