Skip to content

Commit

Permalink
Merge pull request #71 from absurdprofit/development
Browse files Browse the repository at this point in the history
Refactor to avoid persisting config to history state.
  • Loading branch information
absurdprofit authored Sep 7, 2024
2 parents 9287a3b + 658be67 commit e8b3d37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/stack/src/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export class Screen extends ScreenBase<ScreenProps, ScreenState, RouteProp> {

protected setConfig(newConfig: NonNullable<ScreenProps["config"]>): 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() {
Expand Down

0 comments on commit e8b3d37

Please sign in to comment.