mosesintech
TTCTheo's Typesafe Cult
•Created by mosesintech on 2/13/2024 in #questions
html-react-parser and "Unsafe call of an `any` typed value".
Thank you for the reply 🙂
The parser can take a string, so I assumed
{parser(
${item.label})}
would work.
The function already comes with a return type, which is why I'm pretty confused. The package defines it as typeof domToReact
. As far as I can tell, it doesn't return any
.
Could the linter just be wrong here?5 replies
TTCTheo's Typesafe Cult
•Created by mosesintech on 9/20/2023 in #questions
TypeScript error: Type 'string' is not assignable to union value
Actually @shiroyasha9, it fixed the compile issue I had but it isn't actually checking the type right.
If I have requiredIndicator as "TEXTs", it still works. Shouldn't that cause an error?
10 replies
TTCTheo's Typesafe Cult
•Created by mosesintech on 9/20/2023 in #questions
TypeScript error: Type 'string' is not assignable to union value
You are exactly right.
I took a look at how I was using the package in the wild and realized I was doing exactly that, so past me must have known something that present me forgot:
Thanks for the help @shiroyasha9. You're the best
10 replies
TTCTheo's Typesafe Cult
•Created by mosesintech on 9/20/2023 in #questions
TypeScript error: Type 'string' is not assignable to union value
On this branch (feature/typesafe-v1). Running
npm run start
spins up the example app in example/src/app.tsx
using data from example/data/query.json
https://github.com/TotalityWorks/wpgravitybundle/blob/feature/typesafe-v1/example/src/app.tsx
I get the error when I run start.
Full error message:
10 replies
TTCTheo's Typesafe Cult
•Created by mosesintech on 5/17/2023 in #questions
SVGs in Next
I like that a lot! Don't know why I never thought of it before, but it solved all the issues I was having. Thanks Ronan!
5 replies