正如我们所知,如果我们在Function Component中使用useState,则不会在该函数组件的re-renders上每次都创建状态,而是使用现有状态。请看下面的Example函数组件: // Declare a new state variable, which we'll call "count"button> );其中,当我们在custo
我使用React钩子来表示状态,但是当我使用useState时,它显示了一个错误,即: Line 9:29: React Hook "React.useState" is called in function "form" that is neithera React function component nor a cust