3 ms·
Agreed, that is a very good analogy. I was thinking whilst writing that, one of the exceptions where existence of a parent component can/should be assumed is us
by davnicwil 9y ago
Agreed, that is a very good analogy. I was thinking whilst writing that, one of the exceptions where existence of a parent component can/should be assumed is using the 'provider' pattern with React context.
And actually, thinking about it for a bit, I see now that css variables could be used to avoid the inconvenience of piping props through to deep children for styling, in a similar way. Still though, like React context, if it's used at all I think it's a special case pattern to use in specific, encapsulated situations where you really need that benefit.