Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Why would components in this Blazor app fail to render?

$
0
0

I'm writing a Blazor app and obviously I want to get some components rendered in there. I've just tried adding a basic navigation element to my main layout but it's not rendering. I can see the element on the DOM, but that element is empty.

I went with some fairly simple content to start with in my NavMenu component that I'm trying to include on MainLayout.cshtml:

<h1>WHYYYY????</h1>

I've also taken a pretty simple layout on my MainLayout.cshtml page:

@inherits BlazorLayoutComponent<NavMenu /><div class="body-content">    @Body</div>

The file structure in my project seems uncomplicated:

enter image description here

So I'm at a loss here as to what I've overlooked. It looks like Blazor knows there's something it should be rendering to the page - that's why I can see the NavMenu element in the DOM. But there's never any content rendered inside that element. What's missing?

NavMenu Blazor component

I'm running the latest (at time of writing) version of Blazor: 0.5.1.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>