index.js:1375 Warning: A component is changing an uncontrolled input of type che

574 阅读1分钟
index.js:1375 Warning: A component is changing an uncontrolled input of type checkbox to be controlled. 
Input elements should not switch from uncontrolled to controlled (or vice versa). 
Decide between using a controlled or uncontrolled input element for the lifetime of the component. 
More info: https://fb.me/react-controlled-components
<input type="checkbox" checked={indexArr[rindex]} 
                        onChange={()=>this.onChange(rindex)}/>

是因为indexArr[]这个数值是空,操作它的时候就会出现上面这种错误显示,目前是使indexArr[]值不为空就可以了