Skip to content
Open
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
4 changes: 2 additions & 2 deletions smo-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"react-i18next": "^16.2.3",
"react-leaflet": "^4.2.1",
"react-leaflet-custom-control": "^1.4.0",
"react-window": "^1.8.11",
"react-window": "^2.2.2",
"rxjs": "^7.8.2",
"wellknown": "^0.5.0"
},
Expand All @@ -46,7 +46,7 @@
"@types/lodash": "^4.17.20",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.1",
"@types/react-window": "^1.8.8",
"@types/react-window": "^2.0.0",
Copy link

Choose a reason for hiding this comment

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

Bug: Updating react-window to v2.0+ without migrating ListBoxComponent causes TypeError due to removed props and data property.
Severity: CRITICAL | Confidence: 1.00

🔍 Detailed Analysis

The ListBoxComponent.tsx uses properties like itemData, overscanCount, outerElementType, and innerElementType with FixedSizeList from react-window. These properties were removed in react-window v2.0. Additionally, the renderRow function expects a data property within ListChildComponentProps, which is no longer present in v2.0+. This will cause data to be undefined, leading to a TypeError when data[index] is accessed. This occurs when the search autocomplete attempts to render the list.

💡 Suggested Fix

Update ListBoxComponent.tsx to align with react-window v2.0+ API. This involves changing itemData={itemData} to rowProps={{ data: itemData }} and adjusting other removed props.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: smo-frontend/package.json#L49

Potential issue: The `ListBoxComponent.tsx` uses properties like `itemData`,
`overscanCount`, `outerElementType`, and `innerElementType` with `FixedSizeList` from
`react-window`. These properties were removed in `react-window` v2.0. Additionally, the
`renderRow` function expects a `data` property within `ListChildComponentProps`, which
is no longer present in v2.0+. This will cause `data` to be `undefined`, leading to a
`TypeError` when `data[index]` is accessed. This occurs when the search autocomplete
attempts to render the list.

Did we get this right? 👍 / 👎 to inform future reviews.

"@types/wellknown": "^0.5.8",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
Expand Down
28 changes: 10 additions & 18 deletions smo-frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@
"@babel/types" "^7.4.4"
esutils "^2.0.2"

"@babel/runtime@^7.0.0", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.18.3", "@babel/runtime@^7.23.2", "@babel/runtime@^7.23.9", "@babel/runtime@^7.27.6", "@babel/runtime@^7.8.4":
"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.18.3", "@babel/runtime@^7.23.2", "@babel/runtime@^7.23.9", "@babel/runtime@^7.27.6", "@babel/runtime@^7.8.4":
version "7.28.2"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.28.2.tgz#2ae5a9d51cc583bd1f5673b3bb70d6d819682473"
integrity sha512-KHp2IflsnGywDjBWDkR9iEqiWSpc8GIi0lgTT3mOElT0PP1tG26P4tmFI2YvAdzgq9RGyoHZQEIEdZy6Ec5xCA==
Expand Down Expand Up @@ -3496,12 +3496,12 @@
dependencies:
"@types/react" "*"

"@types/react-window@^1.8.8":
version "1.8.8"
resolved "https://registry.yarnpkg.com/@types/react-window/-/react-window-1.8.8.tgz#c20645414d142364fbe735818e1c1e0a145696e3"
integrity sha512-8Ls660bHR1AUA2kuRvVG9D/4XpRC6wjAaPT9dil7Ckc76eP9TKWZwwmgfq8Q1LANX3QNDnoU4Zp48A3w+zK69Q==
"@types/react-window@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@types/react-window/-/react-window-2.0.0.tgz#9fe45015d6f98ec98a069362518c855fcc1fa8d0"
integrity sha512-E8hMDtImEpMk1SjswSvqoSmYvk7GEtyVaTa/GJV++FdDNuMVVEzpAClyJ0nqeKYBrMkGiyH6M1+rPLM0Nu1exQ==
dependencies:
"@types/react" "*"
react-window "*"

"@types/react@*", "@types/react@^18.3.10":
version "18.3.10"
Expand Down Expand Up @@ -5344,11 +5344,6 @@ math-intrinsics@^1.0.0, math-intrinsics@^1.1.0:
resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9"
integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==

"memoize-one@>=3.1.1 <6":
version "5.2.1"
resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e"
integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==

merge2@^1.3.0, merge2@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
Expand Down Expand Up @@ -5790,13 +5785,10 @@ react-refresh@^0.17.0:
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.17.0.tgz#b7e579c3657f23d04eccbe4ad2e58a8ed51e7e53"
integrity sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==

react-window@^1.8.11:
version "1.8.11"
resolved "https://registry.yarnpkg.com/react-window/-/react-window-1.8.11.tgz#a857b48fa85bd77042d59cc460964ff2e0648525"
integrity sha512-+SRbUVT2scadgFSWx+R1P754xHPEqvcfSfVX10QYg6POOz+WNgkN48pS+BtZNIMGiL1HYrSEiCkwsMS15QogEQ==
dependencies:
"@babel/runtime" "^7.0.0"
memoize-one ">=3.1.1 <6"
react-window@*, react-window@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/react-window/-/react-window-2.2.2.tgz#09a7a8b2b1d3ab68e45c757c28f22a015f117adc"
integrity sha512-kvHKwFImKBWNbx2S87NZOhQhAVkBthjmnOfHlhQI45p3A+D+V53E+CqQMsyHrxNe3ke+YtWXuKDa1eoHAaIWJg==

react@^18.2.0:
version "18.3.1"
Expand Down
Loading