TGTelmo Goncalvesinh.telmo.is·Feb 12, 2021 · 4 min readHow to use CSS variablesSince I learned about CSS variables that's all I've been using for my projects. This website aside from using TailwindCSS I'm always using CSS variables as well. Let us take a look how we can accomplish that. Per class One way of doing this is by a ...00
TGTelmo Goncalvesinh.telmo.is·Feb 11, 2021 · 5 min readLearn how to destructure objects and arraysDestructuring is a convenient way of extracting multiple values from data stored in objects and Arrays. Let's take a look on how to destructure an object: const info = { name: 'Telmo', age: 33, twitterHandler: '@telmo' } // Destructure data from `i...00
TGTelmo Goncalvesinh.telmo.is·Feb 10, 2021 · 3 min readHow to set default values while destructuringOne really handy thing JavaScript provide us is destructuring. I love it and it can make our code much cleaner. Let us take a look at a simple piece of code: const profile = { name: 'Telmo', twitter: '@telmo', age: 34, } Now, if we want to acc...00
TGTelmo Goncalvesinh.telmo.is·Feb 9, 2021 · 4 min readA neat way of building React componentsI'll explain one of the best way (in my opinion) to keep your React components clean and reusable. I'll be using TypeScript for this and we'll start with a simple Button component: type Props = { children: string } function Button({ children }: Pr...05SSCPS
TGTelmo Goncalvesinh.telmo.is·Feb 9, 2021 · 4 min readHow to use filter() Array with JavaScriptRecently I've found out about filtering array using type guards, such as Number or Boolean and I thought it would be good to write a small post about it. I've posted a tweet about this, which contain a really neat trick in my opinion. Let's do this....01C