Thanks for filing a bug! To save time, if you're having trouble using the library, please check off the items you have tried. If you are just asking a question, skip right to the bottom.
I'm using these library versions:
ReactJS.NET: 5.2.12
Runtime environment:
.NET Framework or .NET Core Version:
Steps to reproduce
Load component with @Html.ReactWithInit()
Add @Html.ReactInitJavascript() lower on the page
Component ReactDOM.hydrate method is added within the component within the DomContentLoaded right below the @Html.ReactWithInit() function, and again without the DCL next to to the @Html.ReactInitJavascript() declaration.
The issue is that the code is duplicated onto the page adding unnecessary page weight.
Expected change:
Update @Html.React and @Html.ReactWithInit function to accept the skipLazyInit property that is exposed on the CreateComponent() function to allow adding a component without readding it later on.
Use cases:
The simple use case is to avoid duplicate code, but the secondary use case would be to be able to hydrate a component earlier on the page than trying to hydrate the rest of the components lower on with the @Html.ReactInitJavascript() code.
Thanks for filing a bug! To save time, if you're having trouble using the library, please check off the items you have tried. If you are just asking a question, skip right to the bottom.
I'm using these library versions:
ReactJS.NET
: 5.2.12Runtime environment:
Steps to reproduce
The issue is that the code is duplicated onto the page adding unnecessary page weight.
Expected change: Update @Html.React and @Html.ReactWithInit function to accept the skipLazyInit property that is exposed on the CreateComponent() function to allow adding a component without readding it later on.
Use cases: The simple use case is to avoid duplicate code, but the secondary use case would be to be able to hydrate a component earlier on the page than trying to hydrate the rest of the components lower on with the @Html.ReactInitJavascript() code.