4 ms·
I wouldn't encourage doing that because it breaks encapsulation of your children. Like state, you shouldn't peer into another component's refs. But that should
by spicyj 11y ago
I wouldn't encourage doing that because it breaks encapsulation of your children. Like state, you shouldn't peer into another component's refs.
But that should continue to work fine.
- d0m 11y agoI think it's fine when the parent and children are really tied together. I wouldn't use that from the main component to a really nested children for instance. Let's say you have a "SearchComponent" with a "SearchButtonComponent" and "SearchInputComponent", I'm okay with using the strategy I suggested because using "SearchInputComponent" without its parent somewhere else in the code would be too risky so the encapsulation is still kept between parent/children.