diff --git a/docs/Performance.md b/docs/Performance.md index f63bc6f2c6960e..e9c4c01bbf571f 100644 --- a/docs/Performance.md +++ b/docs/Performance.md @@ -73,6 +73,17 @@ This is unavoidable: a lot more work needs to be done at runtime to provide you When running a bundled app, these statements can cause a big bottleneck in the JavaScript thread. This includes calls from debugging libraries such as [redux-logger](https://github.com/evgenyrodionov/redux-logger), so make sure to remove them before bundling. +You can also use this [babel plugin](https://babeljs.io/docs/plugins/transform-remove-console/) that removes all the `console.*` calls. You need to install it first with `npm i babel-plugin-transform-remove-console --save`, and then edit the `.babelrc` file under your project directory like this: +```json +{ + "env": { + "production": { + "plugins": ["transform-remove-console"] + } + } +} +``` +This will automatically remove all `console.*` calls in the release (production) versions of your project. ### `ListView` initial rendering is too slow or scroll performance is bad for large lists