Yiaoma
Yiaoma
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Yiaoma on 4/18/2023 in #questions
Next-auth/Clerk for single user?
Is it still advised to use auth solution for a single user?
3 replies
TTCTheo's Typesafe Cult
Created by Yiaoma on 2/3/2023 in #questions
React rendering on different viewport
I'm currently making a custom Navbar with drop-downs, with should behave differently depending on a viewport, is it better to have same navbar written twice with html and hidden with css or rather change functionality of one depending on a viewport with React?
4 replies
TTCTheo's Typesafe Cult
Created by Yiaoma on 1/24/2023 in #questions
Creating vertical word slider in React
Is there any way to recreate this vertical word slider in React, without manipulating the DOM? This is my version in vanilla JS https://codepen.io/Yiaoma/pen/WNKzQay
1 replies
TTCTheo's Typesafe Cult
Created by Yiaoma on 11/25/2022 in #questions
Has anyone faced Error read EINVAL when deploying NextJs to CPanel?
I'm trying to deploy NextJs application to CPanel, followed official documentation on creating a custom server, getting Error read EINVAL code in logs.
25 replies
TTCTheo's Typesafe Cult
Created by Yiaoma on 11/24/2022 in #questions
Retrieving data without using getServerSideProps and not exposing API keys
In my application I have a custom _app file which restricts using getServerSideProps but I need to retrive data from and external API without exposing keys, what is the best possible way to go about it?
15 replies
TTCTheo's Typesafe Cult
Created by Yiaoma on 11/24/2022 in #questions
Is useEffect hook good place to manipulate DOM?
Have been developing a multiple state components, was wondering is useEffect hook is good place to add css classes for elements?
export const Input: React.FC<InputProps> = (props) => {
const { label, name, error, ...restProps } = props;
const inputElement = useRef(null);

useEffect(() => {
inputElement.current.classList.remove(`${styles.inputError}`);

if (error) {
inputElement.current.classList.add(`${styles.inputError}`);
}
}, [error]);

return (
<div className={styles.inputGroup}>
<label className={styles.label} htmlFor={name}>
{label}
</label>
<input
ref={inputElement}
className={styles.input}
id={name}
name={name}
{...restProps}
/>
{error && <p>{error}</p>}
</div>
);
};
export const Input: React.FC<InputProps> = (props) => {
const { label, name, error, ...restProps } = props;
const inputElement = useRef(null);

useEffect(() => {
inputElement.current.classList.remove(`${styles.inputError}`);

if (error) {
inputElement.current.classList.add(`${styles.inputError}`);
}
}, [error]);

return (
<div className={styles.inputGroup}>
<label className={styles.label} htmlFor={name}>
{label}
</label>
<input
ref={inputElement}
className={styles.input}
id={name}
name={name}
{...restProps}
/>
{error && <p>{error}</p>}
</div>
);
};
17 replies
TTCTheo's Typesafe Cult
Created by Yiaoma on 11/19/2022 in #questions
Astro or NextJS for single page website with contact form?
Hello everyone, I'm currently remaking a single page website with contact form and wanted to ask for advice. I thought is would a be an overkill to make it in NextJS so I thought I would go with Astro, is it possible to use nodemailer with Astro if i want to host my website on cpanel? Thank you in advance
9 replies