replace method
Replaces the current history entry.
Implementation
@override
void replace(Uri uri, {Object? state}) {
action = .replace;
index = this.state?.index ?? 0;
final historyState = HistoryState(
identifier: this.state?.identifier ?? generateIdentifier(),
index: index ?? 0,
userData: state,
);
window.history.replaceState(
historyState.toJson().jsify(),
'',
createHref(uri),
);
}