Implementing an existing JavaScript library
The best approach, in my opinion, is to avoid porting JavaScript libraries. Blazor needs to keep the DOM and the render tree in sync, and having JavaScript manipulate the DOM can jeopardize that.
Most component vendors, such as Telerik, Synfusion, Radzen, and, of course, Blazm
, have native components. They don’t just wrap JavaScript but are explicitly written for Blazor in C#. Even though the components use JavaScript in some capacity, the goal is to keep that to a minimum.
So, if you are a library maintainer, my recommendation would be to write a native Blazor version of the library, keep JavaScript to a minimum, and, most importantly, not force Blazor developers to write JavaScript to use your components.
Some components will be unable to use JavaScript implementations since they need to manipulate the DOM.
Blazor is pretty smart when syncing the DOM and render tree, but try to avoid manipulating the DOM. If you...