Fix element-ref-across-components example #463
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #462
cc: @hakenr ... I'm going to paste the issue text here for easy reference. I'll chat with Dan and Larry soon about using the latest SDK to get the collection simplification feature.
The article section at ...
https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-javascript-from-dotnet?view=aspnetcore-9.0#reference-elements-across-components
... is OK. However, the sample apps aren't fully functional. In the old days, the samples merely provided code. Lately, we've been fixing up the old samples to run as well. The element-ref-across-components approach requires a couple of changes in the early sample apps:
red
CSS class is missing.SurveyPrompt
in the homepage breaks the app because it doesn't adopt the strategy.I also found out that the collection simplification can be placed into these pre-C# 12.0 apps because the latest compiler is smart enough to magically ✨ compile the code. I'll chat with Dan and Larry offline about the wisdom of having devs use the latest SDK for any given earlier version. We will NOT use the new C# feature. We'll just stick with ...
... in <8.0 code. AND ... it wouldn't build here anyway because I use the SDK for each release build in the code validation Action script.