title: C# Blazor Error BL0005 - Setting Component Properties Properly
body: <p>I have done the research I can on this error and just not understanding the correct solution.</p>
  <p>Example code (taken directly from the vendors sample)<br/>
  <a href="https://blazor.syncfusion.com/documentation/menu-bar/getting-started/" rel="nofollow noreferrer">https://blazor.syncfusion.com/documentation/menu-bar/getting-started/</a></p>
  <pre><code>&lt;SfMenu Items=&quot;@MenuItems&quot;&gt;&lt;/SfMenu&gt;
  
  @code {
      public List&lt;MenuItem&gt; MenuItems = new List&lt;MenuItem&gt;{
          new MenuItem{ Text = &quot;File&quot;, Items = new List&lt;MenuItem&gt;{
              new MenuItem{ Text= &quot;Open&quot; },
              new MenuItem{ Text= &quot;Save&quot; },
              new MenuItem{ Text= &quot;Exit&quot; }}
      },
          new MenuItem{ Text = &quot;Edit&quot;, Items = new List&lt;MenuItem&gt;{
              new MenuItem{ Text= &quot;Cut&quot; },
              new MenuItem{ Text= &quot;Copy&quot; },
              new MenuItem{ Text= &quot;Paste&quot; }}
      },
          new MenuItem{ Text = &quot;View&quot;, Items = new List&lt;MenuItem&gt;{
              new MenuItem{ Text = &quot;Toolbars&quot; },
              new MenuItem{ Text = &quot;Zoom&quot; },
              new MenuItem{ Text = &quot;Full Screen&quot; }}
      },
          new MenuItem{ Text = &quot;Tools&quot;, Items = new List&lt;MenuItem&gt;{
              new MenuItem{ Text= &quot;Spelling &amp; Grammar&quot; },
              new MenuItem{ Text= &quot;Customize&quot; },
              new MenuItem{ Text= &quot;Options&quot; }}
      },
          new MenuItem{ Text = &quot;Go&quot; },
          new MenuItem{ Text = &quot;Help&quot; }
      };
  }
  </code></pre>
  <p>This will generate the BL0005 Component parameter 'Text' should not be set outside it's component. It will do that with all of the parameters.</p>
  <p>This is code setting the variable to pass to the child component. I see no other way of setting this.  There is no individual setter provided by the component.   I really don't understand how the VS team wants me to build and pass this data (and obviously the vendor doesn't either if their code compiles with the same warnings).</p>
  <p>Can anyone provide a concrete example of how this should be done?<br/>
  I have read <a href="https://stackoverflow.com/questions/59381788/correct-way-to-mutate-a-component-property-in-blazor">Correct way to mutate a component property in blazor</a> but I obviously can't modify the child component in this case since it is a third party library.</p>