Skip to content

Commit

Permalink
fix: prevent forwarding context to TopItemListContainer's DOM element (
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderkranz authored Jan 28, 2024
1 parent 5b2b7c9 commit c50b23d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Virtuoso.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,11 @@ const WindowViewport: React.FC<React.PropsWithChildren<unknown>> = ({ children }
}

const TopItemListContainer: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => {
const TopItemList = useEmitterValue('TopItemListComponent')
const TopItemList = useEmitterValue('TopItemListComponent') || 'div'
const headerHeight = useEmitterValue('headerHeight')
const style = { ...topItemListStyle, marginTop: `${headerHeight}px` }
const context = useEmitterValue('context')
return React.createElement(TopItemList || 'div', { style, context }, children)
return React.createElement(TopItemList, { style, ...contextPropIfNotDomElement(TopItemList, context) }, children)
}

const ListRoot: React.FC<ListRootProps> = /*#__PURE__*/ React.memo(function VirtuosoRoot(props) {
Expand Down

0 comments on commit c50b23d

Please sign in to comment.