React Typescript - Adding custom attribute

后端 未结 2 718
失恋的感觉
失恋的感觉 2021-02-13 06:09

React Typescript allow to add custom data-* attributes. But is it possible to add custom attributes like \'name\' || \'test\' act. ?



        
2条回答
  •  半阙折子戏
    2021-02-13 06:53

    there is another way... skipping the static check (typescript don't do dynamic)

    { 
      const allowedProps = {test: "not-data-attribute"}
      
    }
    

提交回复
热议问题