Enable babel-plugin-transform-react-jsx-source in development for better warning messages #958

Closed
opened 2025-08-09 17:18:19 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @gaearon on 3/6/2017

In Create React App, we enable babel-plugin-transform-react-jsx-source in development configuration. I would suggest you to do the same.

It must only be enabled in development (since it produces bigger bundles). When it is enabled, React warnings get component stack traces with exact line numbers.

Example before:

Example after:

Hope you find this useful!

*Originally created by @gaearon on 3/6/2017* In [Create React App](https://github.com/facebookincubator/create-react-app), we enable [babel-plugin-transform-react-jsx-source](https://www.npmjs.com/package/babel-plugin-transform-react-jsx-source) in development configuration. I would suggest you to do the same. It must **only** be enabled in development (since it produces bigger bundles). When it is enabled, React warnings get component stack traces with exact line numbers. Example before: ![](https://pbs.twimg.com/media/CtCpNoiWcAAO9nk.jpg) Example after: ![](https://pbs.twimg.com/media/CtCpPEMXgAAw1bq.jpg) Hope you find this useful!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#958
No description provided.