Mr Void
Explore posts from serversload custom css after a package is loaded
perhaps this doesn't belong in this forum, I apoloize
I'm trying to override the variables from a css file that belongs to a package, but can't seem to do that because what I write in
index.css
file gets overriden by the package file's css which loads later.
Is there a way for me to import an additional css file after the package is loaded?4 replies
Prevent re-rendering many components when object in store-array is updated
I have a grid view where multiple card components are rendered.
The issue is that all cards are re-rendered when one of the cards' data is updated in the store. Is there a way to prevent re-rendering everything when one object in the array is modified?
This is how the card is modified:
and here is how i load & filter cards
17 replies
nested router, root leads to 404
I wish have the waterfall effect on rendering parent -> child components but I'm facing an issue with the following configuration. When I navigate to
/flashcards
I get redirected to Page404
.
I've tried doing the same as the docs:
parent is a wrapper component and contains sub-components including it's root:
In my case, Flashcards
is the wrapper component
FlashcardsOverview
is the component which should render when navigating to /flashcards
and FlashcardCollectionsView
should render as a child component of FlashcardsOverview
when navigating to /flashcards/collection/:id
How can I achieve this?
Why does this configuration cause 404 ?5 replies
solid-router | return Navigate as component
Is there any way to return
<Navigate href="/auth/login" />
as a component rather than an element?
On version [email protected]
I was able to return an element for a route, however the new version 0.12
requires a component instead.
2 replies
How to keep store in sync with supabase's multitab session?
A logged in user's data is stored in store:
When a user signs out within the app, store is reset to default values. So far it works as expected.
However, if the logged in user is viewing the app on multiple tabs and logs out on one of them then rest of the tabs remain active because store is not synced between tabs.
I asked this on Supabase's forum and got the following response:
Me: I have noticed that when a session is active on one tab, it doesn't refresh on other tabs. After some searching, I came across this PR: https://github.com/supabase/gotrue-js/pull/566 It mentions that storageKey should be used for the channel's name. What is- and where is the storageKey obtained from?
Moderator: storageKey is used to separate the supabase clients so they don't interact. If you don't use it in createClient options then all of the tabs should be in sync.
Me: Tabs are in sync how? For example, I store the logged in user's data in a redux- like store. Should I subscribe to some type of auth event in order to know if a user is logged out?
Moderator: Supabase-js is set up to keep the local storage in sync for multiple tabs. I don't know what redux-like storage is in the context here. I don't think you said what your environment is. But on simple javascript browser Supabase uses local storage to keep the tabs in sync (or it is supposed to). If you are doing something with sessions on your own then you would need to describe that method and see if someone has ideas.I'm not quite sure how to proceed here. I inspected the local-storage and found that an access key is stored there:
sb-[app id]-auth-token: { access_token: ... }
Is there a way to listen to this change?
How can I keep the tabs in sync, with store in mind?3 replies
component doesnt react to changes in state
I've got a component that has a state
collaborators
which holds an array of objects.
The problem is that when this state is modified, through setCollaborators
function, the component does not update for the new value.
why is this happenin, and how can I work around this issue?
49 replies
Is there any way of caching an image loaded from a url?
I've got images stored on supabase's storage and the first time a component renders, it creates a signedUrl and uses that url within the image element. However, this happens each time the component re-renders.
I wish to avoid the loading time by caching the image itself, not the link. Is this possible? If so how?
Could the image data be cached in solid store?
1 replies
accessing store multiple time, in batch() causes infinite loop
Calling store's function within the loop causes infinite rendering. The batch function is inside
createEffect
.
How could I avoid an infinite loop, while still updating the objects 1 by 1 ?8 replies
Warning when modal uses state
I have created a context provider
ModalProvider
that is meant to display a modal whenever it's visible
state is true. This container is displayed on top of any other element that exists within the App
.
It worked well, until I created a state within the modal itself - at which point it began throwing the following warning:
Why does this happen when myModal
component is using a state? ( this is displayed in the ModalProvider
)
https://stackblitz.com/edit/solidjs-templates-bnxz3s?file=src%2FApp.tsx5 replies
Custom ProtectedRoutes component does not render elements on URL match
I've created a custom component
here is a minimal version: https://stackblitz.com/edit/solidjs-templates-gkkfyr?file=src%2FApp.tsx
ProtectedRoutes
which is rendered within App.tsx
. The purpose is to check the URL that the user is viewing, allow or deny based on store.user.isAuthenticated
variable.
There are also two sub-components for ProtectedRoutes
.
One is AllowAuthenticated
:
And similarly, the other is DenyAuthenticated
which redirects the user to a default URL for authenticated users.
Here's what the ProtectedRoutes
component looks like:
For some reason, when URL is /
or any of the children paths /dashboard
, /profile
- their contents are not rendered on the page.
However, not using Allow/DenyAuthenticated
elements, then the pages are rendered as expected.
What might be the issue here?here is a minimal version: https://stackblitz.com/edit/solidjs-templates-gkkfyr?file=src%2FApp.tsx
1 replies
Is the following a "clean" way of handling modals?
I'm trying to figure out a "clean", "best-practice" way of handling modals in an app.
Have been experimenting in the following playground:
https://playground.solidjs.com/anonymous/d3e943ee-e2fd-48e8-87ce-76d271f72b23
Please take a look and let me know if you have any feedback, or what your thoughts are regarding this
3 replies
child-components not updating when parent state is modified.
Paragraph component:
https://pastebin.com/raw/Y9tM6qgN
Word component:
https://pastebin.com/raw/zR6JCYbD
Description
The Paragraph component keeps track of Word components' data within a signal.
It contains
toggleWordMark
function which is passed to each Word component as a callback function.
Each Word, when clicked, calls toggleWordMark
and its data is updated within the Paragraph's words
signal.
Problem
The word components are not re-rendered when the Paragraph state is modified.14 replies