Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ function WorkspaceCompanyCardsTableHeaderButtons({policyID, selectedFeed, should
<View
style={[styles.alignItemsCenter, styles.gap3, shouldShowNarrowLayout ? [styles.flexColumnReverse, styles.w100, styles.alignItemsStretch, styles.gap5] : styles.flexRow]}
>
{shouldDisplayTableComponents && <Table.SearchBar />}
{shouldDisplayTableComponents && (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ PERF-4 (docs)

Creating a new array on every render causes unnecessary re-renders. When passing a single style, pass the style object directly instead of wrapping it in an array.

Suggested fix:

<View style={styles.mnw200}>
    <Table.SearchBar />
</View>

<View style={[styles.mnw200]}>
<Table.SearchBar />
</View>
)}
<View style={[styles.flexRow, styles.gap3]}>
{shouldDisplayTableComponents && <Table.FilterButtons style={shouldShowNarrowLayout && [styles.flex1]} />}
<ButtonWithDropdownMenu
Expand Down
4 changes: 4 additions & 0 deletions src/styles/utils/sizing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export default {
minWidth: 120,
},

mnw200: {
minWidth: 200,
},

w40: {
width: '40%',
},
Expand Down
Loading