Is it possible to get a reference to a Bootstrap 5 bootstrap.Modal via IJSRuntime and save a reference to that instance to later use it?
Example:
I can show a modal with this method:
await _jsRuntime.InvokeVoidAsync("eval", $"new bootstrap.Modal(document.getElementById('myId')).show()");
But I can't hide it the same way because I need to store a reference to the new bootstrap.Modal creation. How can I do this dynamically (I have a bootstrap modal component) without having to write javascript? Is there some way we can save variables and reference them later through the IJSRuntime?