https://pulumi.com logo
#general
Title
# general
g

glamorous-printer-66548

09/19/2018, 11:16 PM
is there a way to pass certain properties down the component hierarchy (from parent -> child) without passing the property explicitly to the childs constructor? I.e. think of something like Reacts Context API.
i

incalculable-sundown-82514

09/19/2018, 11:18 PM
There is not, unfortunately. You’d have to pass the data to each child’s constructor.
w

white-balloon-205

09/20/2018, 1:32 AM
Note that we do inherit some - like
provider
and
protect
down the hierarchy already today. It's reasonable that we could add something like
.context
on components that gets inherited in a similar way, reaching up to the root of the hierarchy to find a value. That would though make the interface for a component much less explicit - they would presumably then depend on some ambient
context
being provided. @glamorous-printer-66548 Curious if you have a design for this in mind that you think would work well? If so, would be great to open a GH issue with the suggestion to track this (and disucss).