Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blazor] Cannot use RenderMode in Generic BaseComponent #59190

Open
1 task done
garrettlondon1 opened this issue Nov 27, 2024 · 1 comment
Open
1 task done

[Blazor] Cannot use RenderMode in Generic BaseComponent #59190

garrettlondon1 opened this issue Nov 27, 2024 · 1 comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates

Comments

@garrettlondon1
Copy link

garrettlondon1 commented Nov 27, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Image

Causes error: Using the generic type 'BaseViewModelView' requires 1 type arguments

  • Remove the @rendermode and it works totally fine

Expected Behavior

I am able to use @rendermode attributes in generic base components

Steps To Reproduce

add @rendermode RenderMode.InteractiveServer to a page with a generic typeparam

Picture above is BaseViewModelViewCore razor page
Below code is BaseViewModelView which page @inherits


public abstract class BaseViewModelView<TViewModel> : BaseViewModelViewCore, IAsyncDisposable
    where TViewModel : IViewModel

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Nov 27, 2024
@garrettlondon1 garrettlondon1 changed the title Cannot use RenderMode in Generic BaseComponent [Blazor] Cannot use RenderMode in Generic BaseComponent Nov 27, 2024
@garrettlondon1
Copy link
Author

Hey @javiercn , am I doing something wrong here? Rendermode is not compiling properly. Also, can we switch this label to area-blazor for better tagging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

No branches or pull requests

1 participant