Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

261
Vistas
Any problem using localStorage instead of $page.params.id in Sveltekit?

In sveltekit, any problem using localStorage for passing along a post id from a list to a detail or edit page instead of using $page.params.id?

Instead of having a page "edit/[id].svelte" it will just be "edit.svelte".

Should be easy to understand without showing any code. I know it has been somewhat answered e g for react and perhaps the answer is the same but I only know svelte. Similar to this question: Using localstorage in React apps instead of useContext

Pros and cons? Any risk of it being slow to setItem before getItem in edit.svelte compared to using $page.params.id?

One advantage is VS Code, having a more practical and clear file structure. The thing that started me thinking about this. Instead of a directory with edit/[id].svelte it would just be edit.svelte.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Those are two very different things, if you have edit/[id].svelte you can have server side rendering, while if you rely on localStorage you can not do that at all.

I see no benefits to doing this at all, even think you are making your code unnecessary complicated.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda