Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing from within a sub component #191

Closed
CraigChamberlain opened this issue Mar 22, 2021 · 3 comments
Closed

Routing from within a sub component #191

CraigChamberlain opened this issue Mar 22, 2021 · 3 comments

Comments

@CraigChamberlain
Copy link

I have been trying to navigate to a new page from within a component. However, the page does not load properly, the component containing the link is simply replaced with content of the correct page but other items that should be removed remain on the page.

If there is a correct way to route back via to the primary router it would be maybe good to see in the examples.

Following this example when I hit the link to PageX, component A is replaced by PageX but component B is not removed unless I hit refresh and the routing works correctly.

--Home.Svelte
<A />
<B />

--A.Svelte
...
<Link to="/PageX">Some  Content</Link>
...
@CraigChamberlain
Copy link
Author

Does a link need to be inside a router in the sub-component or is it enough for it to be nested inside the master router?

@CraigChamberlain
Copy link
Author

This is actually a problem with the Carousel failing on removal which then stops the rest of the page being processed. Is there a way to make this more fault tollerent?

index.mjs:199 Uncaught (in promise) TypeError: Cannot read property 'removeChild' of null
at detach (index.mjs:199)
at detach_dev (index.mjs:1592)
at Object.destroy [as d] (Carousel.svelte:68)
at Object.destroy [as d] (Carousel.svelte:14)
at destroy_component (index.mjs:1434)
at Object.destroy [as d] (Carousel.svelte:64)
at Object.destroy [as d] (Carousel.svelte:63)
at Object.destroy [as d] (utils.js:331)
at destroy_component (index.mjs:1434)
at Object.destroy [as d] (Carousel.svelte:63)


@CraigChamberlain
Copy link
Author

Simply wrapping Carousel with a div sorted the problem which appears to have nothing to do with this package.

beyonk-group/svelte-carousel#35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant