ForwardRef is a technique for automatically passing a ElementRef through a component to one of its children or back from children to parent or among independent components.
This is typically not necessary for most components in the application. However, it can be useful for some kinds of components, especially in reusable component libraries. The most common scenarios are described below.

Capture references to elements

From Blazor documentation we know that you can capture references to HTML elements in a component using the following approach:

Add a ref attribute to the HTML element.

Define a field of type ElementRef whose name matches the value of the ref attribute.
The following example shows capturing a reference to the username<input> element:

<inputref="username".../>
@functions {
ElementRef username;
}

Problematics

Problem in passing a ElementRef to its children or another component

If you try to pass the ElementRef to another component (children or neighbor), it will not work.
Because ref returns the value at the Render moment after the parameters have been applied.
The value can be applied after the following StateHasChanged().

Index.razor

Summary

In my opinion, this is one of the best ElementRef transfer techniques among the components.
Of course, in the class, you can add events with subscription and unsubscribe, and much more, for example Observable.
That I used in the development of the MatBlazor components for Tooltip and Menu.

Introduction

If you are a web developer and are developing for a browser, then you are sure know JS, which can be executed inside a browser. There is an opinion that JS is not very suitable for complex calculations and algorithms. And although in recent years JS has made a big breakthrough in performance and wide of use, many developers continue to dream of launching a system language inside the browser. In the near future, the game may change thanks to WebAssembly.

Microsoft is not standing on place and actively trying to port .NET to WebAssembly. As one of the results, we received a new framework for client-side development - Blazor. It is not quite clear yet whether Blazor can be faster than modern JS frameworks like React, Angular, Vue due to WebAssembly. But it definitely has a big advantage - development in C # as well as the whole .NET Core world can be used inside the application.