- Fewer features
- Not static
- Not type safe
- No built-in intellisense support
Using JS interop in Blazor is messy at best. Importing scripts and methods requires you to use hard-coded string values. Hard-coded values are historically susceptible to annoying misspellings and frustrating debugging sessions. Interop code must be carefully implemented as it exists outside of what Blazor tracks in the DOM. Mutating an object via both JS and Blazor is a sour recipe for undefined behavior. Lastly, interop introduces a new level of complexity which accelerates the rate of entropy in our application, exacerbating the possibility of bugs.
Ultimately, the most likely scenario for having to using the JS interop feature will exist due to a third-party library such as GoogleMaps not offering native Blazor support.
- Double check to see if a Blazor library does not already exist for your use case
- If a library does not exist, look to see if you can re-create the behavior natively in Blazor
- Keep vigilant for third party developers' releasing native Blazor components