React Dev tools show my Component as Unknown

后端 未结 4 1824
半阙折子戏
半阙折子戏 2021-01-31 16:14

I have the following simple component:

import React from \'react\'
import \'../css.scss\'

export default (props) => {
  let activeClass = props.out ? \'is-ac         


        
4条回答
  •  孤街浪徒
    2021-01-31 16:38

    This happens when you export an anonymous function as your component. If you name the function (component) and then export it, it will show up in the React Dev Tools properly.

    const MyComponent = (props) => {}
    export default MyComponent;
    

提交回复
热议问题