From what I understand the recommended method to hide null warnings on services is the following:
[Inject] private IExampleService ExampleService { get; set; } = default!;I'm wondering if the same applies to components that are given a reference in code behind with the @ref notation or if this should be handled differently?
For example using DevExpress components:
<DxButton Text="Button" @ref=ExampleButton />@code { private DxButton ExampleButton { get; set; } = default!;}If I understand this correctly the renderer populates the ExampleButton property after rendering so null exceptions are possible if the property is used in an OnInitialized() method therefor I am unsure if !default is the correct approach.
I was hoping DevExpress themselves would have some documentation about this, however I was unable to find anything.