diff --git a/Forte.Web.React/Configuration/ReactConfiguration.cs b/Forte.Web.React/Configuration/ReactConfiguration.cs
index c961d71..e926592 100644
--- a/Forte.Web.React/Configuration/ReactConfiguration.cs
+++ b/Forte.Web.React/Configuration/ReactConfiguration.cs
@@ -27,10 +27,10 @@ public class ReactConfiguration
public string NameOfObjectToSaveProps { get; set; } = "__reactProps";
///
- /// Name of the object used to save global context. Default value is "__globalContext".
- /// NameOfGlobalContextToSave is supported by method.
+ /// Name of the object used to save global data object. Default value is "__globalData".
+ /// NameOfGlobalDataToSave is supported by method.
///
- public string NameOfGlobalContextToSave { get; set; } = "__globalContext";
+ public string NameOfGlobalDataToSave { get; set; } = "__globalData";
///
/// Indicates whether caching is used. Default value is "true".
diff --git a/Forte.Web.React/ForteWebReactExtensions.cs b/Forte.Web.React/ForteWebReactExtensions.cs
index c840b3a..2d4b0b8 100644
--- a/Forte.Web.React/ForteWebReactExtensions.cs
+++ b/Forte.Web.React/ForteWebReactExtensions.cs
@@ -49,7 +49,7 @@ public static void AddReact(this IServiceCollection services,
public static void UseReact(this IApplicationBuilder app, IEnumerable scriptUrls, Version reactVersion,
bool disableServerSideRendering = false, string? nameOfObjectToSaveProps = null,
- string? nameOfGlobalContextToSave = null, bool? useCache = null, bool? strictMode = null)
+ string? nameOfGlobalDataToSave = null, bool? useCache = null, bool? strictMode = null)
{
var config = app.ApplicationServices.GetService();
@@ -62,7 +62,7 @@ public static void UseReact(this IApplicationBuilder app, IEnumerable sc
config.ScriptUrls = scriptUrls.ToList();
config.ReactVersion = reactVersion;
config.NameOfObjectToSaveProps = nameOfObjectToSaveProps ?? config.NameOfObjectToSaveProps;
- config.NameOfGlobalContextToSave = nameOfGlobalContextToSave ?? config.NameOfGlobalContextToSave;
+ config.NameOfGlobalDataToSave = nameOfGlobalDataToSave ?? config.NameOfGlobalDataToSave;
config.UseCache = useCache ?? true;
config.StrictMode = strictMode ?? false;
}
diff --git a/Forte.Web.React/HtmlHelperExtensions.cs b/Forte.Web.React/HtmlHelperExtensions.cs
index 5f4c9b6..c78bca7 100644
--- a/Forte.Web.React/HtmlHelperExtensions.cs
+++ b/Forte.Web.React/HtmlHelperExtensions.cs
@@ -17,33 +17,33 @@ namespace Forte.Web.React;
public static class HtmlHelperExtensions
{
#if NET48
- public static IHtmlString React(this HtmlHelper _, string componentName, T props, object? globalContext = null)
+ public static IHtmlString React(this HtmlHelper _, string componentName, T props, object? globalData = null)
{
var reactService = DependencyResolver.Current.GetService();
- var renderedComponent = reactService.RenderToStringAsync(componentName, props, globalContext: globalContext)
+ var renderedComponent = reactService.RenderToStringAsync(componentName, props, globalData: globalData)
.GetAwaiter().GetResult();
return new HtmlString(renderedComponent);
}
- public static IHtmlString React(this HtmlHelper _, TComponent component, object? globalContext = null)
+ public static IHtmlString React(this HtmlHelper _, TComponent component, object? globalData = null)
where TComponent : IReactComponent
{
var reactService = DependencyResolver.Current.GetService();
var renderedComponent = reactService
- .RenderToStringAsync(component.Path, null, component.RenderingMode, globalContext)
+ .RenderToStringAsync(component.Path, null, component.RenderingMode, globalData)
.GetAwaiter().GetResult();
return new HtmlString(renderedComponent);
}
public static IHtmlString React(this HtmlHelper _, TComponent component,
- object? globalContext = null)
+ object? globalData = null)
where TComponent : IReactComponent where TProps : IReactComponentProps
{
var reactService = DependencyResolver.Current.GetService();
var renderedComponent = reactService
- .RenderToStringAsync(component.Path, component.Props, component.RenderingMode, globalContext).GetAwaiter()
+ .RenderToStringAsync(component.Path, component.Props, component.RenderingMode, globalData).GetAwaiter()
.GetResult();
return new HtmlString(renderedComponent);
@@ -60,33 +60,33 @@ public static IHtmlString InitJavascript(this HtmlHelper _)
#if NET6_0_OR_GREATER
public static async Task ReactAsync(this IHtmlHelper htmlHelper, string componentName, T props,
- object? globalContext = null)
+ object? globalData = null)
{
var reactService = htmlHelper.ViewContext.HttpContext.RequestServices.GetRequiredService();
return new HtmlString(
- await reactService.RenderToStringAsync(componentName, props, globalContext: globalContext));
+ await reactService.RenderToStringAsync(componentName, props, globalData: globalData));
}
public static async Task ReactAsync(this IHtmlHelper htmlHelper, TComponent component,
- object? globalContext = null)
+ object? globalData = null)
where TComponent : IReactComponent
{
var reactService = htmlHelper.ViewContext.HttpContext.RequestServices.GetRequiredService();
return new HtmlString(
- await reactService.RenderToStringAsync(component.Path, null, component.RenderingMode, globalContext));
+ await reactService.RenderToStringAsync(component.Path, null, component.RenderingMode, globalData));
}
public static async Task ReactAsync(this IHtmlHelper htmlHelper,
- TComponent component, object? globalContext =
+ TComponent component, object? globalData =
null) where TComponent : IReactComponent where TProps : IReactComponentProps
{
var reactService = htmlHelper.ViewContext.HttpContext.RequestServices.GetRequiredService();
return new HtmlString(
await reactService.RenderToStringAsync(component.Path, component.Props, component.RenderingMode,
- globalContext));
+ globalData));
}
public static IHtmlContent InitJavascript(this IHtmlHelper htmlHelper)
diff --git a/Forte.Web.React/React/ReactService.cs b/Forte.Web.React/React/ReactService.cs
index ffe5598..608a1fa 100644
--- a/Forte.Web.React/React/ReactService.cs
+++ b/Forte.Web.React/React/ReactService.cs
@@ -18,7 +18,7 @@ public interface IReactService
Task RenderAsync(TextWriter writer, string componentName, object? props = null, RenderOptions? options = null);
Task RenderToStringAsync(string componentName, object? props = null,
- RenderingMode renderingMode = RenderingMode.ClientAndServer, object? globalContext = null);
+ RenderingMode renderingMode = RenderingMode.ClientAndServer, object? globalData = null);
}
public class ReactService : IReactService
@@ -67,7 +67,7 @@ public ReactService(INodeJSService nodeJsService, IJsonSerializationService json
}
#endif
- private async Task InvokeRenderTo(Component component, object? props = null, object? globalContext = null, params object[] args)
+ private async Task InvokeRenderTo(Component component, object? props = null, object? globalData = null, params object[] args)
{
var allArgs = new List