简体   繁体   中英

React Dev Tools does not show Component Names or State Variable Names

This is a screenshot of the new React Dev Tools in Google Chrome:

反应开发工具

Only the top level component name AdminArea shows. This component is in my script's entry file, index.jsx . There should also be AddNewCoupon and ViewCoupons components. No filters are enabled.

Notice also the state hook naming inside the component only says "State". These are booth useState() hooks.

The useReducer's initial state variable names can be seen, but only because I'm directly exporting and importing that variable into the entry file index.jsx .

Anyone know how to fix these labelling issues?

Actually there's no current solution to this problem I was going to open a Github issue about this but it turned out that Bryan Vaughn opened the issue himself:). Here is the reference to Github issue . Cheers, sigfried.

Update

Now it's possible to show the names within the DevTools, click the magic wand in the top right corner: 点击魔法棒按钮

And that will become: 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM