1
votes

I have a component which is used by different kind of components (parents). This component's behaviour slightly depends on who is his parent (the kind of parent).

Ofcourse I can pass the parent's name as a prop or bind or ...

My question: Is it possible for the nested component to find out by itself who is the parent? during onMount?

1

1 Answers

2
votes

No, and this is by design. If the parent and child components are designed to work together, they can communicate via props, events, or using the Context API.