Casacobra
Safari Video Not AutoPlaying when inside a Suspense
Hey everyone ! Not sure if this is intended to happen but it’s a bug. When you have a video html tag with:
It doesn’t render on Safari specifically when it’s inside a
<Suspense>
. If placed outside it renders automatically in Safari. Does anyone know why this happens?
Seems like a weird bug.12 replies
Best approach for using createResource
I have a question. The
createResource
should be used outside the component and not inside the component, is this a correct statement? I only ask because I noticed the fetcher runs twice if put inside a component vs having it outside the component?3 replies
Outlet issue on routes
Hey everyone, I'm struggling at the moment with setting up my routes...
I have the following in
app.tsx
:
I'm not sure if I'm setting up the routes here correctly, but I keep getting an error when it comes to no exported outlet.
In my /flags/[:id]
route i have a useParam()
and this is whats throwing the error. Is there a reason why I keep getting this error. Nothing renders.
6 replies
Reactivity when passing props down not reactive on nested component
Hi guys and girls, I'm currently struggling with reactivity. Here's a look at the code:
ParentComponent.tsx
If I add this in the parent to test, everything works correctly and properties are reactive. However, when I move this into another component ChildComponent.tsx
I loose reactivity and instead get static values...
ParentComponent.tsx
:
ChildComponent.tsx
:
Any help would be greatly appreciated, thanks in advance!17 replies
Authorization still triggering fetch when using conditional routing for AuthProvider
Hi guys and girls, I'm currently running into an issue where I have some basic routing in an auth provider. On mount it checks if there is a user / session. If no session or user is present, I redirect to the
/login
page. This all works. The minute I am not logged in, but visit /
or /bookings
it still runs any createResource
present on that page. In my use case I'm actually using createCachedResource
which is @lxsmnsyc library. In my case the cache is storing the empty results when I login again. Was wondering how you'd go about preventing anything from fetching until the auth is resolved.
What I see happening is, when you visit /bookings
and you're not logged in, it runs that route figures out if you're logged in or not, then redirects to login. But at that point the fetcher has already started.6 replies
Is this considered good practice?
Hey! I have a createResource that only runs when
params.id
and isEditMode
are active. My question. Is this considered a good practice?
My component has 2 modes. Create and Editing. I'm trying to combine both into one view. Is it good practice to create 2 api fetches from a createResource
and conditionally handle what the output is in a createEffect
?
I would love some feedback on the code below and maybe explain if this is a good approach.
The goal is, if your in editMode it skips fetching products, but requires to fetch schedules, so you at least have a schedule to attach your new product too. Otherwise, if you're editing a product, I want to fetch both and then include all the product data into the fields by default.
7 replies