I've just found out I can do:
interface Product {
name: string,
price: number,
category: string,
id: string,
quantity: number
}
bagTotal = (products: Product[]) => {
}
which is useful but I have this. where bag is one of my props coming from my redux store
interface IBagProps {
bag: {
products: Product[]
}
}
so in the parameters of the function I want to use the bag props from the IBagProps interface
how do I this?
I wanted to do something like this: bagTotal = (products: IBagProps) => {
but that looks like it's going to pass all the props through
bagTotal = (products: Product[]) ...?