4 ms·
Neither this comment nor the article clearly spell this out: when you use the production version of React, much of the developer-assisting error checking is rem
by kderbe 11y ago
Neither this comment nor the article clearly spell this out: when you use the production version of React, much of the developer-assisting error checking is removed (not just propTypes[1], but many other error checks[2]), so you don't need to worry about the end-user performance impact of propTypes.
As an example of how much this helps, one React-heavy page of mine dropped from 1500ms to 300ms by switching versions, according to my browser profiler.
[1] https://facebook.github.io/react/docs/reusable-components.html#prop-validation https://facebook.github.io/react/docs/reusable-components.ht...
[2] https://facebook.github.io/react/downloads.html#development-vs.-production-builds https://facebook.github.io/react/downloads.html#development-...
- davnicwil 11y agoOP is talking about compiling react in prod mode yourself, having pulled the source as an npm dependency, as opposed to pulling in the pre-built prod version with a script tag. See the npm section right below the Individual Downloads section you've linked to in [2] - this is the recommended, and more common, way to use react.