Why you should use react.js unminified during development

Facebook’s React javascript library is gaining popularity. When using third party javascript code, it’s easy to download the minified version and develop against that as you’ll want the minified version in production anyway.

React, however, is an example of why this isn’t always the best policy. The console.log messages, stripped from the minified build, are a valuable source of information to help improve code.

Switching to the unminified build of React for development flagged up the following warnings for my app, which helps eliminate bugs and ensure code follows best practices.

Unknown DOM property autofocus. Did you mean autoFocus?

bind(): You are binding a component method to the component. React does this for you automatically in a high-performance way, so you can safely remove this call.

Each child in an array should have a unique "key" prop.

To maintain simplicity and ensure minified, optimised code in production, make it part of your build process to include the minified version, while developing against the unminified library to benefit from the warnings it provides.

Read more

For further information see:

Tags: