@tanstack/react-router 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2037,13 +2037,18 @@
2037
2037
  // router can be used in a non-react environment if necessary
2038
2038
  startReactTransition = fn => fn();
2039
2039
  update = newOptions => {
2040
+ const previousOptions = this.options;
2040
2041
  this.options = {
2041
2042
  ...this.options,
2042
2043
  ...newOptions
2043
2044
  };
2044
- this.basepath = `/${trimPath(newOptions.basepath ?? '') ?? ''}`;
2045
+ if (!this.basepath || newOptions.basepath && newOptions.basepath !== previousOptions.basepath) {
2046
+ this.basepath = `/${trimPath(newOptions.basepath ?? '') ?? ''}`;
2047
+ }
2045
2048
  if (!this.history || this.options.history && this.options.history !== this.history) {
2046
- this.history = this.options.history ?? (typeof document !== 'undefined' ? createBrowserHistory() : createMemoryHistory());
2049
+ this.history = this.options.history ?? (typeof document !== 'undefined' ? createBrowserHistory() : createMemoryHistory({
2050
+ initialEntries: [this.options.basepath || '/']
2051
+ }));
2047
2052
  this.latestLocation = this.parseLocation();
2048
2053
  }
2049
2054
  if (this.options.routeTree !== this.routeTree) {