Encountering an issue while attempting to add a string to an array. Any assistance would be welcome.
Error message @ onClick:
Type '(productName: string) => number' is not compatible with type '() => void'.ts(2322) types.d.ts(59, 5): The expected type is derived from property 'onClick' which is defined here on type 'IntrinsicAttributes & ButtonProps'
The relevant code snippet is provided below
const productList : string[] = [];
const handleClick = useCallback((productName:string) => productList.push(productName),[]);
JSX
<Button primary onClick={handleClick}>Add Product</Button>