+ 1

Regarding state in react

In rfce , how to declare a state?is it similar to that in normal components?

7th Jan 2021, 6:54 PM
Shubhank Kulshreshtha
Shubhank Kulshreshtha - avatar
5 Antworten
+ 1
In rfce ,you can declare useState as following const [state, setstate]=React.useState()
7th Jan 2021, 7:07 PM
Abhay
Abhay - avatar
+ 1
Shubhank Kulshreshtha yes ,also a typo ,it was useState not newState
7th Jan 2021, 7:19 PM
Abhay
Abhay - avatar
+ 1
Yup , got that . Thanks 😊
7th Jan 2021, 7:20 PM
Shubhank Kulshreshtha
Shubhank Kulshreshtha - avatar
+ 1
Refer to the React tutorial here.
7th Jan 2021, 9:25 PM
Sonic
Sonic - avatar
0
Abhay you mean like hooks right
7th Jan 2021, 7:18 PM
Shubhank Kulshreshtha
Shubhank Kulshreshtha - avatar