mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-22 11:52:00 +00:00
Update strict-mode.md (#3426)
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
This commit is contained in:
@@ -116,6 +116,10 @@ At first glance, this code might not seem problematic. But if `SharedApplication
|
||||
|
||||
By intentionally double-invoking methods like the component constructor, strict mode makes patterns like this easier to spot.
|
||||
|
||||
> Note:
|
||||
>
|
||||
> Starting with 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](https://github.com/facebook/react/issues/20090#issuecomment-715927125).
|
||||
|
||||
### Detecting legacy context API {#detecting-legacy-context-api}
|
||||
|
||||
The legacy context API is error-prone, and will be removed in a future major version. It still works for all 16.x releases but will show this warning message in strict mode:
|
||||
|
||||
Reference in New Issue
Block a user