Loris Sigrist
Loris Sigrist
SSolidJS
Created by Loris Sigrist on 3/28/2024 in #support
[solved] Can't use `@solidjs/router` in external package for SolidStart
I'm trying to write a library for my SolidStart project & need to use the A component exported from @solidjs/router in the library. However, when I use the library in the app it breaks & complains that it needs to be wrapped in <Router>. If I copy paste the library code into the SolidStart project it suddenly works flawlessly. Does anyone know what's going on? For context, I'm trying to create a builder function that returns a wrapped A component, like so:
import { createNavigationInLibrary} from "my-library"
const { A } = createNavigationInLibrary();
import { createNavigationInLibrary} from "my-library"
const { A } = createNavigationInLibrary();
Edit: Some additional context - @solidjs/router is a peerDependency in the library, so it should be using the same version
9 replies