【发布时间】:2020-03-12 11:26:14
【问题描述】:
我是 React 和 Wordpress Gutenberg 块的新手。我想知道下面的代码在 ES5 中会是什么样子。
const MyCheckboxControl = () => (
const [ isChecked, setChecked ] = useState( true );
<CheckboxControl
heading="User"
label="Is author"
help="Is the user a author or not?"
checked={ isChecked }
onChange={ setChecked }
/>
) );
【问题讨论】:
-
这只是一个函数。实际上它看起来是错误的,因为它没有返回 JSX。
-
来自 Wordpress 手册
标签: reactjs wordpress ecmascript-5