Skip to content

Commit b486cda

Browse files
gunnimDaniel15
authored andcommitted
Fixed to to match current setup instructions (#397)
According to https://reactjs.net/getting-started/tutorial.html you run services.AddReact() not app.AddReact()
1 parent fed8c2c commit b486cda

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: src/React.AspNet/HtmlHelperExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static IReactEnvironment Environment
5050
"ReactJS.NET has not been initialised correctly.",
5151
#else
5252
"ReactJS.NET has not been initialised correctly. Please ensure you have " +
53-
"called app.AddReact() and app.UseReact() in your Startup.cs file.",
53+
"called services.AddReact() and app.UseReact() in your Startup.cs file.",
5454
#endif
5555
ex
5656
);

Diff for: src/React.AspNet/HttpContextLifetimeProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private PerRequestRegistrations Registrations
6363
{
6464
throw new ReactNotInitialisedException(
6565
"ReactJS.NET has not been initialised correctly. Please ensure you have " +
66-
"called app.AddReact() and app.UseReact() in your Startup.cs file."
66+
"called services.AddReact() and app.UseReact() in your Startup.cs file."
6767
);
6868
}
6969
return registrations;

Diff for: src/React.AspNet/ReactBuilderExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private static void EnsureServicesRegistered(IApplicationBuilder app)
8888
var registrations = app.ApplicationServices.GetService<HttpContextLifetimeProvider.PerRequestRegistrations>();
8989
if (registrations == null)
9090
{
91-
throw new ReactNotInitialisedException("Please call app.AddReact() before app.UseReact().");
91+
throw new ReactNotInitialisedException("Please call services.AddReact() before app.UseReact().");
9292
}
9393
}
9494

0 commit comments

Comments
 (0)