Azzy dvyastia kesuma
@azzykesumaAll solutions
Advice generator FM
#tanstack-query#typescript#vite#reactSubmitted 5 months agoi have invalidated the query when clicking the button to generate a new advice, but whenever i clicked the button too fast, the returned result from the api always seems to be cached, therefore not changing the advice.
export const useApiQuery = ( queryKey: [string, unknown?], enabled: boolean, ) => { return useQuery({ queryKey, queryFn: async () => { const response = await fetchAdvice(); return response }, enabled, retry: 0, refetchOnWindowFocus: false, staleTime: 0, }); };
tried setting the staletime to 0 but the cache still persist. the network tab show that the browser tries to refetch the api, but it doesn't invalidate the cache inside the disk-cache, so how do i invalidate the cache on demand regardless of what tools i'm using?
Product list challenge
#shadcn#tailwind-css#typescript#vite#motionSubmitted 5 months agoi'm using vite as react-wrapper/compiler for most of my project, and when i'm previewing all of my static assets (prod) , all of them usually broken unless i put it in root public, why is this always be the case?
form challenge
#react#shadcn#typescript#vite#motionSubmitted 5 months agoi think i should be creating my own toast instead of using library made toast like shadcn
multi step form challenge
#motion#redux#tailwind-css#typescript#viteSubmitted 11 months agoany feedback is greatly appreciated
rock paper scissor challenge
#motion#react#tailwind-css#vite#typescriptSubmitted 11 months agoi use a lot of values inside the useContext, which works, but i feel it made my context bloated. i can split the values into multiple context, but i fear that it will make my main.tsx into context wrapper hell, and i also try to avoid using over complicated state management like redux for this simple project. how can i simplify the context without sacrificing code readability?
bookmark landing page challenge
#motion#react#typescript#tailwind-cssSubmitted 12 months agoany feedback is greatly appreciated