UseState Error when utilizing React Hooks

后端 未结 1 960
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 21:16

I am using hooks but I get this error

Line 25: React Hook \"React.useState\" is called in function \"contact\" which is neither a React function component or a custom R

相关标签:
1条回答
  • 2021-01-28 21:32

    The rules-of-hooks lint rule uses naming conventions to infer what functions are for. Functions starting with use are assumed to be hooks. Functions starting with a capital letter are assumed to be components. contact is neither. Change it to Contact.

    0 讨论(0)
提交回复
热议问题