意图的:在一个Vaadin 23应用程序中,我想知道何时更改了属性值。
我尝试了什么:我创建了这个输入公式:
// Text input field
Input input = new Input();
input.setId("myInputField");
Element textInput = input.getElement();
// Change listener for property "value"
// Works well for manual input
// B
因此,以下是警告:
Warning: UserInviteForm is changing an uncontrolled input of type checkbox to be controlled.
在查看了reduxForm v5和其他人的票证后,我似乎收到了此警告,因为该字段的初始值未定义,因此需要使用字段value || "“对输入值属性进行初始化。
进一步检查,受控复选框需要将属性设置为一个值。
因此,我的假设是清除警告的方法是以以下两种方式之一编写输入标记:
<input
{...isPrimary}
value={isPrimary.value || &