KokoNeot
KokoNeot
SSolidJS
Created by KokoNeot on 1/4/2023 in #support
Fetching resources only when logged in
Same here
function UserData({ params, location, navigate, data }) {
// const { logged } = useAuth()
// console.log(logged())
// if (logged() === false) return { userDB: () => {}, playlists: () => [] }

const [userDB] = createResource(fetchUserDB, { initialValue: { timeObj: {}, jobObj: {}}})
const [playlists, { mutate }] = createResource(fetchPlaylists, { initialValue: [] })

return { userDB, playlists, mutatePlaylists: mutate }
}
function UserData({ params, location, navigate, data }) {
// const { logged } = useAuth()
// console.log(logged())
// if (logged() === false) return { userDB: () => {}, playlists: () => [] }

const [userDB] = createResource(fetchUserDB, { initialValue: { timeObj: {}, jobObj: {}}})
const [playlists, { mutate }] = createResource(fetchPlaylists, { initialValue: [] })

return { userDB, playlists, mutatePlaylists: mutate }
}
this was my attempt at route data function but it doesnt work as intended because initially logged is === to null, the AuthContext makes an api call to check if user is logged or not and then its set to true or false but the data function doesnt rerun
2 replies
SSolidJS
Created by KokoNeot on 1/3/2023 in #support
Smooth scroll
thanks
5 replies
SSolidJS
Created by KokoNeot on 1/3/2023 in #support
Smooth scroll
ah just scrollIntoView 😅
5 replies
SSolidJS
Created by KokoNeot on 1/2/2023 in #support
How to pass classes to custom component
I'll give it a try thanks
5 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
classList not working on icons svg
yes but
The main safe situation is when class is set to a static string (or nothing), and classList is reactive
12 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useSearchParams not working
when I do props.hey it actually works thanks but its weird that it doesnt return already filled object
9 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useSearchParams not working
from import { useSearchParams } from "@solidjs/router"
9 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useSearchParams not working
setting works fine
9 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useSearchParams not working
9 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
classList not working on icons svg
thank you both! ill try it out
12 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useParams not working
19 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useParams not working
19 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useParams not working
I had to restructure my routes like so
19 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useParams not working
damn I found the issue
19 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useParams not working
your stackblitz example works because you have the guildID in the <A> href "hardcoded" I need it dynamic based on the route
19 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useParams not working
I expect to have params in the SidePanel component. I'm aware that the SidePanel component is part of DashboardLayout and that is rendered on route /dashboard but it has an outlet component which allows me to show stuff on different routes. What I think is happening here is that the SidePanel component (along with DashboardLayout) thinks that they are only on /dashboard route even though they are at /dashboard/:guildID(/leaderboard)
19 replies
SSolidJS
Created by KokoNeot on 12/29/2022 in #support
useParams not working
19 replies