3 ms·
When introducing Web APIs for general use, I think it's a bad idea to show the example code using react and it's useEffect. Makes the examples less standalone,
by matsemann 6y ago
When introducing Web APIs for general use, I think it's a bad idea to show the example code using react and it's useEffect. Makes the examples less standalone, and harder for some to grok.
- josteink 6y agoI noticed that too, and thought the very same thing. At the same time you had stand-alone code-samples which were of dubious quality at best: if (document.someBoolean) { setEnabled(true); } else { setEnabled(false); } I mean... Really? :) So yeah. Coupled with lots of Chrome-only APIs, I wouldn't consider this a very high quality article.
- ConcernedCoder 6y agolol... yes, that's SMH level stuff... how about: setEnabled( Boolean( document.someBoolean ) )