Header logo.
A study of bugs

Notes tagged with “typescript”


A moment ago I got an error that reads like this:

I was really confused for a moment. Then I realized (() => void) | null means: Either a) a function that neither takes any argument nor returns any value; or b) null.

And () => void | null means a function that does not take any argument. And there are two possibilities when this function returns: Either it doesn't return anything or it returns a null. ⋯

Week 47

I spent some time last week to get myself more familiar with TypeScript.

Although I'd known the syntax, how to type things (props, components, etc) was at times still confusing. I probably saw more than a bunch of errors thrown at me.

Hopefully I'd love it when I get the hang of it. People on the internet say, all pros and cons considered, it's worth the while.