Matt Miller
1 min readFeb 3, 2020

--

How would you approach a situation where the grandparent component needs to subscribe to events from the grandchild component, but you want to uniquely identify the events so that only that one particular instance of the grandparent component subscribes.

For example: a form component has some number of input element children, all of which can trigger events the form wants to subscribe to. You only want this instance of the form to respond to only the events dispatched by the inputs that are descendants of the form.

Is there something you could add to that event that would let the subscriber distinguish that the element is one of its children?

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Matt Miller
Matt Miller

Responses (1)

Write a response