janusqa
janusqa
TTCTheo's Typesafe Cult
Created by janusqa on 1/17/2024 in #questions
How can i correctly past the JS Object to the function in the template string correctly
const payload = {
test1: 1,
test2: 2,
};

const links = `
<a onClick="Lock('/myurl', ${payload});">click me</a>
`;


const Lock = (url, payload) => console.log(payload)
const payload = {
test1: 1,
test2: 2,
};

const links = `
<a onClick="Lock('/myurl', ${payload});">click me</a>
`;


const Lock = (url, payload) => console.log(payload)
an exception is being thrown because "payload" is not arriving in the function correctly. I have also tried
JSON.Stringify(payload)
JSON.Stringify(payload)
2 replies
TTCTheo's Typesafe Cult
Created by janusqa on 5/12/2023 in #questions
Is it possible to pass a zod schema as a prop?
I have this
interface Props {
schema: ZodSchema;
children: React.ReactNode;
defaultValues?: unknown;
}
interface Props {
schema: ZodSchema;
children: React.ReactNode;
defaultValues?: unknown;
}
what is the proper way to type the schema prop on the receiving end?
8 replies
TTCTheo's Typesafe Cult
Created by janusqa on 3/6/2023 in #questions
Error: Cannot find module '@tailwindcss/typography'
How can I resolve this error? I've updated tailwind.config.cjs to require it, it throws no errors but when I save a file this error is shown in the output tab of vscode.
6 replies