mrVinicius
Explore posts from serversuseRouter hook
I'm trying to use the useRouter hook so that I can acquire the base path and pass it into my sidebar component without the end user having to write it themselves. Also, I'd like to acquire all defined routes so that I can match against whatever route was defined in my component, and tell the end user the route defined doesn't exist. But correct me if I'm wrong, is the useRouter hook private?
Upon analyzing the router/index.jsx distribution, I think it is private, right? So that's why I'm getting the previous error.
Could we discuss a PR to expose the useRouter hook, or perhaps a new hook exposing read-only access to this information?
The component im building for better context:
7 replies
createStore doesn't trigger createResource refetch action.
How can I make createResource work with a store, if possible at all? When I pass a simple signal like perPage to createResource, it works smoothly. However, when I pass a whole store to it, it does not trigger the refetch.
5 replies
solidjs pnpm workspace
I'm trying to set up a pnpm workspace to share a library within my main app, but I can't get it to work. I tried to follow a few repository examples, but I have no idea why it's not working.
I made an exact copy of my architecture and the problem im facing: https://github.com/mrVin99/solid-workspace/tree/main
3 replies
Insights on my component library
Hello, i'm building my own component library to fit my project needs. I'm having a bit of a problem with state management
Do anyone have a better way to work with state other than using Provider?
On this particular component im using a signal state to know if its open or not. And i must wrap it into a provider or else when i have two or more dropdown they share state, but passing a provider makes the overall api feels clunky.
Any improvements suggestions?
8 replies
Router isn't working.
Why routing is not working when i'm following exactly what doc says.
Doc: https://docs.solidjs.com/solid-router/getting-started/defining-routes
I'm getting the following error: 'index.tsx:5 Unrecognized value. Skipped inserting'
30 replies
Restricte route by user role, possibly a middleware?
Hello, I would appreciate some assistance from more experienced web developers, if possible.
My issue revolves around user roles and restricting access to certain routes based on those roles. While I've successfully hidden the navigation buttons, there remains an issue: if a user types a restricted route directly into the URL, they can still access the associated component, which is something I want to prevent. Currently, I've implemented a solution where if a user attempts to access a restricted route, they are redirected back to their previous route in history. However, this solution isn't optimal as it causes a momentary loading of the component before the redirection occurs.
- Im using SolidJS SPA + Go server, not SolidStart.
Any insights would be greatly appreciated.
14 replies