News for hackers. Stuff that matters.
Re:Using TypeScript with React by verletx64 on Thursday August 22, 2019 @05:27AM (#20766180)
I’d recommend using ‘unknown’ over ‘any’, it’s truer to the code you’d probably end up writing if it was vanilla JS; fairly defensive stuff.

On top of that don’t be hesitant to define ad hoc interfaces on your side of things; ultimately ‘any’ communicates zero information and provides zero defence.

The more I start to use other techniques the more I feel that ‘any’ really should be the last escape hatch deployed.

There are no comments on this comment yet.