How to turn on/off ReactJS 'development mode'?

后端 未结 7 1291
独厮守ぢ
独厮守ぢ 2020-11-29 17:38

Started using ReactJS\'s prop validation feature, which as the docs say only works in \'development mode\' for performance reasons.

React seems to be validating the

7条回答
  •  野性不改
    2020-11-29 18:24

    Yeah, it's not really well documented, but on the ReactJS download page it talks about development and production modes:

    We provide two versions of React: an uncompressed version for development and a minified version for production. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages.

    Basically, the unminified version of React is "development" mode, and the minified version of React is "production" mode.

    To be in "production" mode, just include the minified version react-0.9.0.min.js

提交回复
热议问题