-
Book Overview & Buying
-
Table Of Contents
Web Development with Blazor - Fourth Edition
By :
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, Syncfusion, Radzen, and, of course, Blazm, have native components. They don't just wrap JavaScript; they're explicitly written for Blazor in C#. Even though the components use JavaScript to some extent, the goal is to keep it 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 because 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 we need to use JavaScript...