From 658be6755686677af3afae30daf6bd7a44c07884 Mon Sep 17 00:00:00 2001 From: absurdprofit Date: Sat, 7 Sep 2024 15:15:36 -0500 Subject: [PATCH] Refactor to avoid persisting config to history state. --- packages/stack/src/Screen.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/stack/src/Screen.tsx b/packages/stack/src/Screen.tsx index 8c7f3b9..692ad5e 100644 --- a/packages/stack/src/Screen.tsx +++ b/packages/stack/src/Screen.tsx @@ -56,7 +56,10 @@ export class Screen extends ScreenBase { protected setConfig(newConfig: NonNullable): void { super.setConfig(newConfig); - this.setHistoryState(({ config }) => ({ config: { ...config, ...newConfig } })); + // navigation history state can only accept structured cloneable objects. + // a lot of the config options are function which cannot be structured cloned. + // for this reason remove this for now unless a good argument is made for persisting config to history state. + // this.setHistoryState(({ config }) => ({ config: { ...config, ...newConfig } })); } protected get router() {