Component capture

This shows how a component reference may be captured as a field value using 'ref' syntax. This feature is intended only for cases where you're triggering an action on the child instance. It should not be used as a way of mutating state in the child, because that would bypass all the benefits of flowing parameters to children and re-rendering automatically only when required.

@if (_toggleCapturedComponentPresence) {
}
External controls
@functions { bool _toggleCapturedComponentPresence = true; CounterComponent _myChildCounter; void ResetChildCounter() { _myChildCounter.Reset(); } }