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

feat(net9.0) RendererInfo support #1613

Open
ArgoZhang opened this issue Nov 16, 2024 · 1 comment
Open

feat(net9.0) RendererInfo support #1613

ArgoZhang opened this issue Nov 16, 2024 · 1 comment

Comments

@ArgoZhang
Copy link

Is the feature request related to a problem? Please elaborate.

Layout component

protected override void OnInitialized()
{
    _isInteractive = RendererInfo.IsInteractive;
}

unit test

public void Layout_OK()
{
    var cut = Context.RenderComponent<Layout>();
    Assert.Contains("Footer", cut.Markup);
}

test run failed

Message: 
  System.InvalidOperationException : No renderer has been initialized.

Stack Trace: 
  RenderHandle.get_RendererInfo()
  ComponentBase.get_RendererInfo()
  Layout.OnInitialized() line 342
  ComponentBase.RunInitAndSetParametersAsync()
  TestRenderer.AssertNoUnhandledExceptions()
  TestRenderer.Render[TResult](RenderFragment renderFragment, Func`2 activator)
  TestRenderer.RenderFragment(RenderFragment renderFragment)
  TestContextBaseRenderExtensions.RenderInsideRenderTree(TestContextBase testContext, RenderFragment renderFragment)
  TestContextBaseRenderExtensions.RenderInsideRenderTree[TComponent](TestContextBase testContext, RenderFragment renderFragment)
  TestContext.Render[TComponent](RenderFragment renderFragment)
  TestContext.RenderComponent[TComponent](Action`1 parameterBuilder)
  LayoutTest.ShowFooter_OK() line 19
  RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
  MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

The suggested solution

Describe any alternative solutions

Additional context

@ArgoZhang
Copy link
Author

link #1596

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant