且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jsx 和 React 中的动态标签名称

更新时间:2021-09-06 03:07:12

没办法就地做,只是把它放在一个变量中 (首字母大写):

No way to do that in-place, just put it in a variable (with first letter capitalised):

const CustomTag = `h${this.props.priority}`;

<CustomTag>Hello</CustomTag>