check if a component is a child or ancestor of another component ReactJS
<p>I am creating a ReactJS Component with an unknown number of children and ancestors, and when a certain event occurs on one of the ancestors I the parent component should know of it. my first approach is to use redux and send the child component with a redux action, and then main parent componetnts will be alerted and will check if the Componetnt sent was one of its ancestors.
but, can a parent reactJS component know in someway if another component is one of its ancestors?</p>