Production mode

Flag can be passed to ReactState.init method. When production is enabled:

  • All manipulations with state from window object are not allowed

  • State is disconnected from window object

  • Warnings are disabled

However if you want to track state manipulations from code you can access them fromStateHistory class

From version process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'prod' check is added to make sure minified bundle is included. If you are using webpack do not forget to add to your production build configuration:

new webpack.DefinePlugin({
    "process.env": {
        NODE_ENV: JSON.stringify("production")
    }
})

Last updated