4 ms·
Could you (or someone else) help me out here? I'd rather like getting an error in this situation, but in my code, with strictNullChecks turned on, TypeScript se
by mercer 10y ago
Could you (or someone else) help me out here? I'd rather like getting an error in this situation, but in my code, with strictNullChecks turned on, TypeScript seems to be fine with the above... What am I missing?
- technion 10y agoUnfortunately all I've got here is that the behaviour can be seen in my boilerplate React app: https://github.com/technion/awesome-sec-audit/blob/master/assets/awesome-sec-audit-run.tsx https://github.com/technion/awesome-sec-audit/blob/master/as... If you insert the element directly in line 25 you'll get: error TS2345: Argument of type 'HTMLElement | null' is not assignable to parameter of type 'Element'.
- mercer 10y agoStrange. On my end it does look like ReactDOM's 'render' method actually accepts HTMLElement | null, and therefore doesn't throw an error.