TypeScript-如何添加注释?

时间:2019-03-21 13:03:54

标签: reactjs typescript

我是TS新手...
我有以下代码:我想注释掉徽标。我尝试添加“ //”和“ / *”,但似乎无济于事。

对此进行了尝试:// <LogoComponent classes={{container: style.logoContainer, svg: style.logoSvg}} />

任何想法

export const HomePageComponent: React.StatelessComponent<HomePageProps> = (props) => {
  return (
    <div className={style.container}>

**COMMENT THIS LINE OUT ?**
      <LogoComponent classes={{container: style.logoContainer, svg: style.logoSvg}} />


      <div className={style.main}>
        <CaptionComponent />
        <SearchInput         
          searchValue={props.searchValue}
          onSearchSubmit={props.onSearchSubmit}
          onSearchUpdate={props.onSearchUpdate}
        />
        <SearchButton onClick={props.onSearchSubmit}/>
          </div>

          <FooterComponent className={style.footer} />


    </div>
  )

1 个答案:

答案 0 :(得分:0)

尝试这种方式

   { /*<LogoComponent classes={{container: style.logoContainer, svg: style.logoSvg}} /> */ }

Wes Bos - How to comment in React JSX

Demo