Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

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.ht...

[2] https://facebook.github.io/react/downloads.html#development-...



OP 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: