Preview Monaco editor input as html on blazor project
Hello i have a .net 8 blazor project where i want to write html inside the monaco code editor and then see it render live just below the editor. The problem is that im not shure about how events are handled coming from react. GPT is suggesting i use " @bind-Value="EditorValue"" but it the console then complains it cant find "value".
I might just be stupid but any help is appreciated,
1 Reply
BlazorMonaco is just a wrapper around the JS implementation and it does not support 2-Way data binding.
If you want to get the code as a string available in C# you need to fetch it from a ref to the editor.
I used the OnDidChangeModelContent event to validate something, but you could also use it to update the current
Code
string in your C#.