Samyar
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Samyar on 7/24/2024 in #questions
how do you handle api calls?
Do you have a pattern or something? fetch seems too bad. i have to add a base url, explicit seach params params and many more things. Im using react query but i still hate the way i do api calls. someone in our team said we should use RTK query. and it handles all the parts.
3 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 6/28/2023 in #questions
is it bad to have many Prisma instances ?
I was using prisma and i was making a new prisma instance for each file and then i got an warning saying
you are having more than 10 active prisma instances at once
so i removed them and just exported one from a file
but im wondering what's the issue with many prisma instances ?6 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 6/20/2023 in #questions
what are the best alternatives for axios ?
Axios uses xhr and i searched a bit about the difference between fetch api and i found ou fetch api has some extra feature and improvements
what else i can use beside axios for requests ?
8 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 6/3/2023 in #questions
nextjs env t3 runtime error
I think i setup everything just as the docs said but i get the bellow error in the attached screenshot
error :
The env variables are correct
I used
z.enum
The terminal doesn't show any errors
one thing: i changed the the file type of the next config from .js
to .mjs
as the one in the docs was because i got an error that said i cant use import statement
im not sure if it's a bug from the package or im doing something wrong
I cant upload the screenshot of the error (discord error) so i will share the link:
https://postimg.cc/5602czFF1 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 4/10/2023 in #questions
nextjs e-commerce template
Hi guys I'm looking for a nextJs template to setup an e-commerce website but I'm not sure what to use, just a fast one. so I came to hear your opinion about setting up an e-commerce website
10 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 3/6/2023 in #questions
Is not providing deps array for useEffect ok?
26 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 1/17/2023 in #questions
_app.tsx file for other folders
I would like to implement layout-based routing in my pages directory. However, since I am using the "pages" directory in Next.js, I am looking for a way to use something similar to the "_app.tsx" file, but only for the files inside a specific folder. This would function similarly to the Remix routing style, where there is a folder, such as "panel," and a file called "__panel.tsx" that wraps the files inside the "panel" folder with a layout. How can I achieve something similar in the Next.js "pages" directory?
1 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 11/14/2022 in #questions
Comment on a text document
Hi
I have a document.
I want to set comments on a specific part of the text.
For commenting I add a span to that part.
Before comment:
After comment:
And then I will update the document with this new data.
But the problem is I have a user role that can only comment on the text and not update the document data.
As you can see my comments are relying on document data because when I add a new comment I need to add a new span element to the document.
What is the solution here?
What can I do to prevent updating the actual data and just letting the user comment on the text and not be able to update the text because it will be a security issue?
What can I do to not let the user change the text between the tags in the backend?
1 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 10/17/2022 in #questions
Can we use Laravel with next?
I have a couple of questions
- Is it reasonable to use Laravel and Next together?
- if yes, should we run both of them together and interact with each other on the same server?
- If u have experience with next can please tell me if most of the time how is the backend is handled? (Next is full-stack so is it necessary to include the backend)
29 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 10/15/2022 in #questions
Fixing React video questions came up to my mind !
4 replies
TTCTheo's Typesafe Cult
•Created by Samyar on 10/12/2022 in #questions
How nextJS optimizes application for SEO?
If it's still an SPA why we can't have good SEO with CRA?
7 replies