-
Notifications
You must be signed in to change notification settings - Fork 926
Html.ReactInitJavaScript() outputs server only components in initialization code #340
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
Comments
I encountered the same problem. The parameter serverOnly don't work. |
I don't think this would be that difficult to "fix", but it would be nice to know if this is indeed a bug/problem or if I have misunderstood the parameter before I attempt to fix it with a PR |
Any input on this @Daniel15 ? |
Interesting, this does sound like a bug to me. Feel free to submit a pull request if you like 😃 |
+1, parameter serverOnly don't work. |
Using
@Html.React("Component", ..., serverOnly: true)
still adds theReactDOM.render()
calls to the@Html.ReactInitJavaScript()
output which breaks pages using server only components. (It also wraps the output in an unnecessary container element)Looking through the code there seems to be missing a bool in the ReactEnvironment
CreateComponent
method that sets the component to be server only and thus skipped when outputting the init code for all componentsThe text was updated successfully, but these errors were encountered: