Asked
Active
Viewed 29 times
0

Sattar Rahim
- 19
- 2
-
What are u trying to achieve? And its always better to post the code and not the screenshot of it. – blessanm86 Jul 08 '22 at 16:42
2 Answers
1
You are using setrefClick incorrectly, it should be like this:
function refreshClick() {
// This will put 8 into refClick
setrefClick(8);
}

Aymendps
- 1,346
- 4
- 20
1
You are doing states wrong.
You are doing it just fine.
In order to initialize state you should follow this syntax
const [state, stateUpdate] = useState(initialValue);
Upon observing your code, you can potentially change your state initialization to a proper way like this.
const [pageTitle, setPageTitle] = useState("Customers");
const [customersCount, setCustomersCount] = useState(5);
And modify the customersCount like this:
setCustomersCount(5);
Edit:
This is just a suggestion, however you can change the customerCount using
setrefClick(8);

markcalendario
- 218
- 2
- 9