You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parameters passed through RenderComponentAsync are lost immediately after prerendering.
To Reproduce
Steps to reproduce the behavior:
Razor Components Preview3 0.9 @(await Html.RenderComponentAsync<html>(new { Example = "something" }))
[Parameter] private string Example {get; set;} is null after prerendering is finished.
Expected behavior
For passed parameters to persist after prerendering is finished.
This is probably an actual issue (it could just be countless hours of sleep derivation at this point).
I figured out a workaround after posting this by creating a component and juggling the parameters; but the reality is the way I was trying to initially do this should have worked out of the box. Whenever I passed Example into the Cascade, it would always be null after Prerendering was finished.
To give you an idea of the weirdness I'm doing at 4:40 AM...
This works as expected, when inside of Body.razor you pass the reference forward as a CascadeValue so that the children Components can get access to the Metatags object.
So yeah, as of 5:40 AM I now have fully proper SEO.. without any weird hacking up Index.cshtml and using unclosed tags.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Parameters passed through RenderComponentAsync are lost immediately after prerendering.
To Reproduce
Steps to reproduce the behavior:
Razor Components Preview3 0.9
@(await Html.RenderComponentAsync<html>(new { Example = "something" }))
[Parameter] private string Example {get; set;}
is null after prerendering is finished.Expected behavior
For passed parameters to persist after prerendering is finished.
This is probably an actual issue (it could just be countless hours of sleep derivation at this point).
I figured out a workaround after posting this by creating a component and juggling the parameters; but the reality is the way I was trying to initially do this should have worked out of the box. Whenever I passed
Example
into the Cascade, it would always be null after Prerendering was finished.To give you an idea of the weirdness I'm doing at 4:40 AM...
This works as expected, when inside of Body.razor you pass the reference forward as a CascadeValue so that the children Components can get access to the Metatags object.
So yeah, as of 5:40 AM I now have fully proper SEO.. without any weird hacking up Index.cshtml and using unclosed tags.
)
The text was updated successfully, but these errors were encountered: