3 ms·
Monkey-patching console.log sounds so hacky.. > In React 17, React automatically modifies the console methods like console.log() to silence the logs in the sec
by lioeters 5y ago
Monkey-patching console.log sounds so hacky..
> In React 17, React automatically modifies the console methods like console.log() to silence the logs in the second call to lifecycle functions. However, it may cause undesired behavior in certain cases where a workaround can be used.
> Starting from React 18, React does not suppress any logs. However, if you have React DevTools installed, the logs from the second call will appear slightly dimmed. React DevTools also offers a setting (off by default) to suppress them completely.
- SirHound 5y agoIt is, I have lost tens of hours to this over the last couple years.
- marcus_cemes 5y agoAlso, these types of global modifications make such libraries fundamentally incompatible with projects such as Tauri that focuse on safety and security. In a recent video of theirs they mentioned that of the popular frameworks, the only one that didn't seem to do any dodgy modifications of the global scope was Svelte (they didn't mention which frameworks failed the test, but I imagine React was one of them).
- joshribakoff 5y agoIt’s totally opt in, and in development only, so react doesn’t prevent you from using that other lib