News for hackers. Stuff that matters.
Re:Using TypeScript with React by SenHeng on Thursday August 22, 2019 @01:18PM (#20770330)
Sounds like an optional variable.

    function fn(arg?: SomeObject)
Or worst still, an or undefined, often found in class variables.

    this.foo: Thing | undefined = undefined;
Easy way to sidestep this error is > if (!arg) return;, but it’s really a code smell of a larger, design issue. As in, the function shouldn’t really be depending on an optional value.

There are no comments on this comment yet.