0

I have a Blazor WASM app and I use a template which comes with a lot of icons. The feather icons load properly on startup or if I reload any page/component, but if I try to navigate to another component without actually reloading the whole page, the icons do not load. This is how call the icons in index.html.

<body class="app">
    <script src="js/app.js"></script>
    <script>
        setTimeout(function () {
            feather.replace();
        }, 3000)
    </script>
</body>

Since it is a single-paged application, it seems the icons do not persist or not passed along when a new child component replaces the old one. This is the main layout.

<div class="flex">
    <SideBar />
    <div class="content">
        @Body
    </div>
</div>
Qudus
  • 1,440
  • 2
  • 13
  • 22
  • That would be the expected behaviour for a SPA. When this is some fade-in/out effect you might be able to trigger it form OnAfterRenderAsync(true). – H H May 04 '21 at 18:32
  • @HenkHolterman Do you mean I should trigger the feather icons from OnAfterRender()? I now trigger it from oninitialized for every component, it works but, still lagging in a component with a lot icons. – Qudus May 04 '21 at 21:10
  • well, I don't know what you want to see when. It depends, you have multiple points in the 'life cycle'. Experiment with the *Async versions. – H H May 05 '21 at 07:31
  • @HenkHolterman Thanks. It worked with OnAfterRenderAsync – Qudus May 05 '21 at 12:48

0 Answers0