diff --git a/build.proj b/build.proj index f702ce175..afbf537d6 100644 --- a/build.proj +++ b/build.proj @@ -11,7 +11,7 @@ of patent rights can be found in the PATENTS file in the same directory. 5 2 - 11 + 13 0 http://reactjs.net/packages/ $(MSBuildProjectDirectory)\tools\MSBuildTasks diff --git a/site/jekyll/tutorials/aspnetcore.md b/site/jekyll/tutorials/aspnetcore.md index 478686691..0a79d245c 100644 --- a/site/jekyll/tutorials/aspnetcore.md +++ b/site/jekyll/tutorials/aspnetcore.md @@ -149,7 +149,7 @@ app.UseReact(config => // .AddScript("~/js/First.jsx") // .AddScript("~/js/Second.jsx"); - // If you use an external build too (for example, Babel, Webpack, + // If you use an external build tool (for example, Babel, Webpack, // Browserify or Gulp), you can improve performance by disabling // ReactJS.NET's version of Babel and loading the pre-transpiled // scripts. Example: diff --git a/src/React.Router/HtmlHelperExtensions.cs b/src/React.Router/HtmlHelperExtensions.cs index 1bbf99914..076638b58 100644 --- a/src/React.Router/HtmlHelperExtensions.cs +++ b/src/React.Router/HtmlHelperExtensions.cs @@ -102,7 +102,12 @@ public static IHtmlString ReactRouter( { var response = htmlHelper.ViewContext.HttpContext.Response; var request = htmlHelper.ViewContext.HttpContext.Request; - path = path ?? request.Path.ToString() + request.QueryString; + var queryString = request != null && request.QueryString != null ? request.QueryString.ToString() : ""; + if (!string.IsNullOrWhiteSpace(queryString) && !queryString.StartsWith("?")) + { + queryString = $"?{queryString}"; + } + path = path ?? request.Path.ToString() + queryString; var reactComponent = Environment.CreateRouterComponent( diff --git a/src/React.Template/reactnet-vanilla/Startup.cs b/src/React.Template/reactnet-vanilla/Startup.cs index 7777ffb1a..6ca7827e5 100644 --- a/src/React.Template/reactnet-vanilla/Startup.cs +++ b/src/React.Template/reactnet-vanilla/Startup.cs @@ -72,7 +72,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF ContractResolver = new CamelCasePropertyNamesContractResolver() }); - // If you use an external build too (for example, Babel, Webpack, + // If you use an external build tool (for example, Babel, Webpack, // Browserify or Gulp), you can improve performance by disabling // ReactJS.NET's version of Babel and loading the pre-transpiled // scripts. Example: