Say I have a child component, a product card, and a parent component, a product page.
Each product card component should have edit and delete functionality.
I was thinking what would be the right approach: to create delete and edit functions inside product card component, because they are only related to this component, or create delete and edit functions inside product page component, then pass these function to children.
I think it's not a good idea to create function inside children, because functions will be recreated for each children, maybe I'm wrong?