title: How to invoke js in blazor anywhere?
body: <p>I'm try to call js on a button onclick event in blazor (server), but I got the error:</p>
  
  <blockquote>
    <p>JavaScript interop calls cannot be issued at this time. This is because the component is being statically rendererd. When prerendering is enabled, JavaScript interop calls can only be performed during the OnAfterRenderAsync lifecycle method.</p>
  </blockquote>
  
  <p>And I'm using Server render mode.</p>
  
  <pre class="lang-cs prettyprint-override"><code>&lt;component type="typeof(App)" render-mode="Server" /&gt;
  </code></pre>
  
  <p>If I use client render mode, it works correctly.</p>