Skip to content

Direct component props injection #70

@inZaCz

Description

@inZaCz

It would be nice if we can put into route something like componentProps which will be then usable directly in <RenderedComponent {route} {...componentProps} /> in router.svelte

Also adding componentProps to route definition alongside compo.
Then we will able to use it correct svelte way:
let { prop1, prop2, } = $props();

Because now it is only accessible inside the {route} property and rendered components needs to find it inside the structure. This limits reusability of components.

using
component: () =>mount(Compo, {target, ...props}) in route declaration does not work well because of target and the Router rendering

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions