#989·cyclejs

History Driver replace problem

Author: FbNCreated May 20, 2022Updated Mar 28, 2023

Having issues after upgrading history driver to latest version (state not replaced).

Looking to code I see that now input is passed as object to underling history lib

if (input.type === 'replace') {
      history.replace({...input});
}

But remix-run/history still require separate params:

  /**
   * Replaces the current location in the history stack with a new one.  The
   * location that was replaced will no longer be available.
   *
   * @param to - The new URL
   * @param state - Data to associate with the new location
   *
   * @see https://github.com/remix-run/history/tree/main/docs/api-reference.md#history.replace
   */
  replace(to: To, state?: any): void;