Thund3rd3v
Thund3rd3v
TTCTheo's Typesafe Cult
Created by Thund3rd3v on 7/11/2023 in #questions
Help needed handling 1k react checkboxes
if I have a state of arrays that has all the selected users id and I have 1000 users and when a user is selected there is lag how would I handle that my current handleUserSelected code:
function handleUserSelected(value: string) {
const currentIndex = selectedUsers.indexOf(value);
const newSelected = [...selectedUsers];

if (currentIndex === -1) {
newSelected.push(value);
} else {
newSelected.splice(currentIndex, 1);
}

setSelectedUsers(newSelected);
}
function handleUserSelected(value: string) {
const currentIndex = selectedUsers.indexOf(value);
const newSelected = [...selectedUsers];

if (currentIndex === -1) {
newSelected.push(value);
} else {
newSelected.splice(currentIndex, 1);
}

setSelectedUsers(newSelected);
}
25 replies
TTCTheo's Typesafe Cult
Created by Thund3rd3v on 5/4/2023 in #questions
Stack?
Hey how would I go about creating a website where you can post minecraft servers and include a image and other users can vote for a server? Is this stack good? - Planet Scale - uploadthing.com - trpc - prisma
4 replies
TTCTheo's Typesafe Cult
Created by Thund3rd3v on 5/3/2023 in #questions
File Upload Supabase + T3 Stack
Hey how would I go about uploading a file with the t3 stack and supabase with a form so basicly I have a form with questions like: server name? description? and then I have a image upload field I dont know how I would upload the image and get the url and store in the database can anyone please help me thanks!!
16 replies