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
* Lazily initialize component JS when using Html.ReactWithInit
* Make Html.ReactWithInit consistent with Html.React
* Fix logic error and add a few tests
Copy file name to clipboardExpand all lines: src/React.AspNet/HtmlHelperExtensions.cs
+8-4
Original file line number
Diff line number
Diff line change
@@ -104,8 +104,10 @@ public static IHtmlString React<T>(
104
104
/// <param name="htmlTag">HTML tag to wrap the component in. Defaults to <div></param>
105
105
/// <param name="containerId">ID to use for the container HTML tag. Defaults to an auto-generated ID</param>
106
106
/// <param name="clientOnly">Skip rendering server-side and only output client-side initialisation code. Defaults to <c>false</c></param>
107
+
/// <param name="serverOnly">Skip rendering React specific data-attributes, container and client-side initialisation during server side rendering. Defaults to <c>false</c></param>
107
108
/// <param name="containerClass">HTML class(es) to set on the container tag</param>
108
109
/// <param name="exceptionHandler">A custom exception handler that will be called if a component throws during a render. Args: (Exception ex, string componentName, string containerId)</param>
110
+
/// <param name="renderFunctions">Functions to call during component render</param>
109
111
/// <returns>The component's HTML</returns>
110
112
publicstaticIHtmlStringReactWithInit<T>(
111
113
thisIHtmlHelperhtmlHelper,
@@ -114,8 +116,10 @@ public static IHtmlString ReactWithInit<T>(
@@ -242,15 +242,26 @@ public virtual string RenderJavaScript()
242
242
/// server-rendered HTML.
243
243
/// </summary>
244
244
/// <param name="writer">The <see cref="T:System.IO.TextWriter" /> to which the content is written</param>
245
+
/// <param name="waitForDOMContentLoad">Delays the component init until the page load event fires. Useful if the component script tags are located after the call to Html.ReactWithInit. </param>
0 commit comments