kapz
kapz
TTCTheo's Typesafe Cult
Created by xyzmani on 2/9/2025 in #questions
Invalid environment variables error | My Biggest Tutorial Ever Video
You are missing the variable SINGLESTORE_USER in your .env file (do not share it here) The error is giving you this info here: Invalid environment variables: { SINGLESTORE_USER: [ 'Required' ] } Errors are helpers (most times), just look closely at what it's trying to say to you! Good luck!
8 replies
TTCTheo's Typesafe Cult
Created by akashamba on 2/9/2025 in #questions
TypeScript React: Confused about icon: Icon and {...}: Props syntax in component props
In way yes, we are "enforcing", so if you add another parameter to the object (let's say you need to add a isActive boolean) your editor will tell you "look the field isActive does not exist in type Props" and so it forces you to add it to the Props type. But the reason we do this mostly is to have autocomplete and types (when you hover for example) when you are working inside the component, specially if your component props are bigger or complex
9 replies
TTCTheo's Typesafe Cult
Created by akashamba on 2/9/2025 in #questions
TypeScript React: Confused about icon: Icon and {...}: Props syntax in component props
1. What's the significance of icon: Icon? Re-naming the object key icon into Icon so it can be used as JSX <Icon /> 1. What does }: Props mean at the end of the parameter list? It’s assigning a typescript type to the object in the function arguments basically saying that
{ icon: Icon, label, href } is of type Props
9 replies