Closed qlaffont closed 1 year ago
:wave: @ryansolid
Are you accessing properties of the returned location?...
const location = useLocation(); // location itself is not a signal that will cause effects to run again.
// BUT the following will create a dependency on location.pathname
const pathname = location.pathname;
Yes i have try this but it doesn't work :/
When I change your effect to access location.pathname
it logs in the browser console each time it changes
createEffect(() => {
console.log("location.pathname", location.pathname);
})
Describe the bug
When I use useLocation, I want to subscribe to location changes. But it seems to not work.
Your Example Website or App
https://github.com/qlaffont/solid-start-issue-router
Steps to Reproduce the Bug or Issue
create-solid version 0.2.31
Welcome to the SolidStart setup wizard!
There are definitely bugs and some feature might not work yet. If you encounter an issue, have a look at https://github.com/solidjs/solid-start/issues and open a new one, if it is not already tracked.
✔ Where do you want to create the app? … solid-start ✔ Which template do you want to use? › bare ✔ Server Side Rendering? … no ✔ Use TypeScript? … yes found matching commit hash: f0860887030e0632949b3f497e279aecb6ed5afd downloading https://github.com/solidjs/solid-start/archive/f0860887030e0632949b3f497e279aecb6ed5afd.tar.gz to /home/quentin/.degit/github/solidjs/solid-start/f0860887030e0632949b3f497e279aecb6ed5afd.tar.gz extracting /examples/bare from /home/quentin/.degit/github/solidjs/solid-start/f0860887030e0632949b3f497e279aecb6ed5afd.tar.gz to /home/quentin/Documents/dev/solid-start/.solid-start cloned solidjs/solid-start#main to /home/quentin/Documents/dev/solid-start/.solid-start ✔ Copied project files
Next steps: 1: cd solid-start 2: pnpm install 3: pnpm run dev --open
To close the dev server, hit Ctrl-C