问题描述
wordpress Gutenberg使用React,但是不幸的是,我对React并不熟悉。我确实非常了解香草JS,我想只在绝对需要的地方使用React语法来处理原始JS。
因此与wordpress UI进行交互的标准方法是返回如下内容:
return (
<input class={ className } value={attributes.author} onChange={ updateAuthor } type="text" />
);
但是我更希望返回以下内容:
let customInput = document.createElement("input");
customInput.type = "text";
customInput.className = "className";
customInput.value = attributes.author;
customInput.onChange = updateAuthor();
return customInput ;
但是,当渲染到wordpress中时,这会导致错误。无论如何,有没有完成这个目标?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)