Skip to content

Commit

Permalink
fix: handle setting display for _viewConfig attribute (#2071)
Browse files Browse the repository at this point in the history
## Description

PR fixing the app freezes due to `react-freeze` 😄
  • Loading branch information
WoLewicki authored and tboba committed Mar 25, 2024
1 parent 307e5ff commit 03cd79e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/components/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ interface ViewConfig extends View {
};
};
};
_viewConfig: {
validAttributes: {
style: {
display: boolean;
};
};
};
}

export class InnerScreen extends React.Component<ScreenProps> {
Expand Down Expand Up @@ -105,6 +112,12 @@ export class InnerScreen extends React.Component<ScreenProps> {
display: false,
};
this.setRef(ref);
} else if (ref?._viewConfig?.validAttributes?.style) {
ref._viewConfig.validAttributes.style = {
...ref._viewConfig.validAttributes.style,
display: false,
};
this.setRef(ref);
}
};

Expand Down

0 comments on commit 03cd79e

Please sign in to comment.