0

i know i did somthing wrong, but idk what XD,, help please

2 Answers2

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