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
Add server-render support for CSS-in-JS (reactjs#589)
* Add callbacks for running custom Javascript during component render
This allows UI libraries like styled-components to work without any extra code in this project
See also reactjs#487reactjs#538
* Add babel integration test
* Add demo using styled-components
* Create abstraction for chaining pre, during, and post render callbacks
* Add dummy comments to fix build (address these later)
* Remove obsolete method reference
* Fix tests
* Cleanup some code around RenderFunctions
* Expose string property instead of closed-over func with side effects
* Fix regression in TransformRender
* Add render functions tests
* Update sample
This still needs to be better organized..
* Fix filename
* Fix build
* Update xml comments
/// <param name="serverOnly">Skip rendering React specific data-attributes, container and client-side initialisation during server side rendering. Defaults to <c>false</c></param>
54
54
/// <param name="containerClass">HTML class(es) to set on the container tag</param>
55
55
/// <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>
56
+
/// <param name="renderFunctions">Functions to call during component render</param>
56
57
/// <returns>The component's HTML</returns>
57
58
publicstaticIHtmlStringReact<T>(
58
59
thisIHtmlHelperhtmlHelper,
@@ -63,7 +64,8 @@ public static IHtmlString React<T>(
Copy file name to clipboardExpand all lines: src/React.Core/IReactComponent.cs
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -54,8 +54,9 @@ public interface IReactComponent
54
54
/// <param name="renderContainerOnly">Only renders component container. Used for client-side only rendering.</param>
55
55
/// <param name="renderServerOnly">Only renders the common HTML mark up and not any React specific data attributes. Used for server-side only rendering.</param>
56
56
/// <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>
57
+
/// <param name="renderFunctions">Functions to call during component render</param>
/// Renders the JavaScript required to initialise this component client-side. This will
@@ -73,8 +74,9 @@ public interface IReactComponent
73
74
/// <param name="renderContainerOnly">Only renders component container. Used for client-side only rendering.</param>
74
75
/// <param name="renderServerOnly">Only renders the common HTML mark up and not any React specific data attributes. Used for server-side only rendering.</param>
75
76
/// <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>
77
+
/// <param name="renderFunctions">Functions to call during component render</param>
Copy file name to clipboardExpand all lines: src/React.Core/ReactComponent.cs
+27-13Lines changed: 27 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -125,14 +125,11 @@ public ReactComponent(IReactEnvironment environment, IReactSiteConfiguration con
125
125
/// <param name="renderContainerOnly">Only renders component container. Used for client-side only rendering.</param>
126
126
/// <param name="renderServerOnly">Only renders the common HTML mark up and not any React specific data attributes. Used for server-side only rendering.</param>
127
127
/// <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>
128
+
/// <param name="renderFunctions">Functions to call during component render</param>
/// <param name="renderContainerOnly">Only renders component container. Used for client-side only rendering.</param>
144
141
/// <param name="renderServerOnly">Only renders the common HTML mark up and not any React specific data attributes. Used for server-side only rendering.</param>
145
142
/// <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>
143
+
/// <param name="renderFunctions">Functions to call during component render</param>
Copy file name to clipboardExpand all lines: src/React.Router/ReactRouterComponent.cs
+13-6Lines changed: 13 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -48,19 +48,26 @@ string path
48
48
/// </summary>
49
49
/// <param name="renderContainerOnly">Only renders component container. Used for client-side only rendering. Does not make sense in this context but included for consistency</param>
50
50
/// <param name="renderServerOnly">Only renders the common HTML mark up and not any React specific data attributes. Used for server-side only rendering.</param>
51
+
/// <param name="renderFunctions">Functions to call during component render</param>
51
52
/// <returns>Object containing HTML in string format and the React Router context object</returns>
0 commit comments