R
R
Ruslan Zolotarev2020-08-04 11:41:55
React
Ruslan Zolotarev, 2020-08-04 11:41:55

How to make component names in react-devtools in production version not be Anonymous?

In general, the task is to make sure that the components are not Anonymous in the display of the React-DevTools component tree. During development, everything works, the components show the names. When I start uploading to hosting, the names disappear. I understand that this is due to the optimization of the bundle and the names disappear, the standard js optimizer. But the task is to show a working solution with the component names in react-devtools.

I work with create-react-app.

As I understand it, it will be necessary to configure webpack under the hood of CRA, who can tell how this is done? Or alternative ways to solve tell me, I will be grateful)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2020-08-04
@ProGatti

If without ejecct, then set displayName for each component.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question