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

Render component and Props #12

Closed
KevinBurton opened this issue Mar 16, 2021 · 1 comment
Closed

Render component and Props #12

KevinBurton opened this issue Mar 16, 2021 · 1 comment

Comments

@KevinBurton
Copy link

I have a significant amount of code on the page (I will call it Grouping.razor). I would like to connect it to the state. Reading the documentation I see that is done by a call to the static 'Get' that returns a RenderFragment. But the samples show the RenderFragment on the page. This seems like a Catch-22. Say my page looks like:

<p> This is a test </p>

and I have code behind that includes the Props like

        [Parameter]
        public GroupingProps Props { get; set; }

From the documentation I see lines like

@page "/counter"

@CounterCmp

@code {
    RenderFragment CounterCmp = CounterConnected.Get();
}

So if I was to extend this to my page I would do something like

<p> This is a test </p>
@GroupingCmp 
@code {
    RenderFragment GroupingCmp = GroupingConnect.Get();
}

I have tried calling 'Get' in OnInitializedAsync and just ignoring the return RenderFragment but the Props parameter is always null. How do I connect the page to the state?

@BerserkerDotNet
Copy link
Owner

There was no way to do it in v1.0. I've added such possibility to v1.1.1, checkout CounterPageConnected

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

2 participants