redux store as number instead of string 1

redux store as number instead of string

Dispacth value after converting it to number

addNumber(Number(value));

Here is what the above code is Doing:
1. We are creating a function called addNumber.
2. We are passing a parameter called value.
3. We are dispatching an action called addNumber.
4. We are passing the value of the input field to the addNumber action.
5. We are converting the value to a number.

Similar Posts