Skip to content

Commit

Permalink
Merge pull request #645 from contember/fix-grid
Browse files Browse the repository at this point in the history
fix(react-datagrid-ui): pass correct env
  • Loading branch information
matej21 authored Nov 27, 2023
2 parents fed1c5a + 79ba1fd commit 36b6b76
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { DataGridContent } from './DataGridContent'
import { DataGridFooter } from './DataGridFooter'
import { DataGridRenderingCommonProps } from '../types'
import { useClassName } from '@contember/react-utils'
import { EnvironmentContext } from '@contember/react-binding'


export const createDataGridContainer = <HeaderProps extends {}, ContentProps extends {}, FooterProps extends {}>({ Header, Content, Footer }: {
Expand All @@ -14,9 +15,11 @@ export const createDataGridContainer = <HeaderProps extends {}, ContentProps ext
}) => memo<HeaderProps & ContentProps & FooterProps & DataGridRenderingCommonProps>(props => {
return (
<Stack className={`${(useClassName('data-grid-body'))}-body`}>
<Header {...props} />
<Content {...props} />
<Footer {...props} />
<EnvironmentContext.Provider value={props.accessor.environment}>
<Header {...props} />
<Content {...props} />
<Footer {...props} />
</EnvironmentContext.Provider>
</Stack>
)
})
Expand Down

0 comments on commit 36b6b76

Please sign in to comment.