I have been trying to use React in an application I am building. One recurring issue I have with React is child to parent component communication. The recommended way seems to be to have the child component emit events which are then caught and handled by the parent component.
Unfortunately, this approach does not work very well in the cases where I have multiple instances of the same component, in which case all the parents will be recieving and handling the event emitted by a single child. I would love to hear any possible solutions for this that do not involve either registering unique event names for each instance of the component or passing in a unique id as part of the event payload, which is then verified by the handler function.