我试图在我的功能组件中使用React useState钩子,但是我得到了这个错误:./src/Person/Person.js
Line 5:43: React Hook "useState" is called in function "person" which is neithera React function component or a custom React
我已经注意到,我可以传递一组嵌套数组,它将正确地呈现项,但是当我这样做时,它不会抱怨我的元素缺少key。const stuff = 'a,b,c';
// React is fine with it and automatically assigns keys
// Sampledata: [[a, <br />], [b, <br />], [c, <br />
当用户在输入之外单击时,我尝试使用mousedown事件来关闭自动完成。但是,当我尝试访问通过react-redux connect传递的mousedown事件的props时,它们都是空的。但是,从父组件传递的属性是存在的。我已经确认,在初始渲染时,react-redux connect道具如预期的那样存在。The connect props are all null", props);