greypixel
greypixel
TTCTheo's Typesafe Cult
Created by greypixel on 7/12/2024 in #questions
Where's the best place to get the hash of a file?
thanks ser 🙂 really appreciate yourtime
15 replies
TTCTheo's Typesafe Cult
Created by greypixel on 7/12/2024 in #questions
Where's the best place to get the hash of a file?
just trying to get the right mental model
15 replies
TTCTheo's Typesafe Cult
Created by greypixel on 7/12/2024 in #questions
Where's the best place to get the hash of a file?
out of interest would there be a way to check the hash before it goes to uploadThing?
15 replies
TTCTheo's Typesafe Cult
Created by greypixel on 7/12/2024 in #questions
Where's the best place to get the hash of a file?
Thanks, super useful 🙂
15 replies
TTCTheo's Typesafe Cult
Created by greypixel on 7/12/2024 in #questions
Where's the best place to get the hash of a file?
Does the file get streamed to my server before uploadThing? Or is the request somehow redirected?
15 replies
TTCTheo's Typesafe Cult
Created by greypixel on 7/12/2024 in #questions
Where's the best place to get the hash of a file?
Thanks, so it's best to do this in onUploadComplete?
15 replies
TTCTheo's Typesafe Cult
Created by greypixel on 7/12/2024 in #questions
Where's the best place to get the hash of a file?
(using Next)
15 replies
TTCTheo's Typesafe Cult
Created by Khao on 6/27/2024 in #questions
I have been trying to get cache working with React-Query and Next.JS
By default React query doesn’t use a persistent cache - so when you refresh you lose everything. Check out the docs here: https://tanstack.com/query/latest/docs/framework/react/plugins/persistQueryClient
6 replies
TTCTheo's Typesafe Cult
Created by greypixel on 3/1/2024 in #questions
Is it possible to render a placeholder to display while a client component loads?
I guess I can do a min-width min-height div with a background color
12 replies
TTCTheo's Typesafe Cult
Created by greypixel on 3/1/2024 in #questions
Is it possible to render a placeholder to display while a client component loads?
but I wanted to render a block that disappears rather than just have component pop in
12 replies
TTCTheo's Typesafe Cult
Created by greypixel on 3/1/2024 in #questions
Is it possible to render a placeholder to display while a client component loads?
I could wrap it in a min-width div sure
12 replies
TTCTheo's Typesafe Cult
Created by greypixel on 3/1/2024 in #questions
Is it possible to render a placeholder to display while a client component loads?
and I don't have control over <SomeClientComponent />
12 replies
TTCTheo's Typesafe Cult
Created by greypixel on 3/1/2024 in #questions
Is it possible to render a placeholder to display while a client component loads?
so nothing to put min-width on
12 replies
TTCTheo's Typesafe Cult
Created by greypixel on 3/1/2024 in #questions
Is it possible to render a placeholder to display while a client component loads?
by default nothing is rendered at all
12 replies
TTCTheo's Typesafe Cult
Created by greypixel on 3/1/2024 in #questions
Is it possible to render a placeholder to display while a client component loads?
Hm, kinda answered my own question here:
"use client";

import { useLayoutEffect, useState } from "react";

export function SomeClientComponent() {
const [isRendered, setIsRendered] = useState<boolean>(false);
useLayoutEffect(() => {
setIsRendered(true);
}, []);
return !isRendered ? (
<div className="h-10 w-[180px] rounded-sm bg-red-300">&nbsp;</div>
) : (
<SomeClientComponent />
);
}
"use client";

import { useLayoutEffect, useState } from "react";

export function SomeClientComponent() {
const [isRendered, setIsRendered] = useState<boolean>(false);
useLayoutEffect(() => {
setIsRendered(true);
}, []);
return !isRendered ? (
<div className="h-10 w-[180px] rounded-sm bg-red-300">&nbsp;</div>
) : (
<SomeClientComponent />
);
}
This seems to work pretty well, guess I'll make a component to wrap this behaviour
12 replies