mirror of
https://github.com/gosticks/react-table.git
synced 2026-07-04 19:30:02 +00:00
fix(use-flex-layout): fix flex layout hook to use new internal hooks
This commit is contained in:
22
README.md
22
README.md
@@ -111,11 +111,9 @@ Hooks for building **lightweight, fast and extendable datagrids** for React
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Nicholas Kaufmann</li>
|
||||
<li><a href="https://www.metso.com/">Pekka</a></li>
|
||||
<li>Jon Eickmeier</li>
|
||||
</ul>
|
||||
<div>Nicholas Kaufmann</div>
|
||||
<div><a href="https://www.metso.com/">Pekka</a></div>
|
||||
<div>Jon Eickmeier</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -130,14 +128,12 @@ Hooks for building **lightweight, fast and extendable datagrids** for React
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Sortmy.games</li>
|
||||
<li>Hugo Meissner</li>
|
||||
<li>Benoit Leger-Derville</li>
|
||||
<li>Thomas Funk</li>
|
||||
<li>Dan Houle</li>
|
||||
<li>David Pickut</li>
|
||||
</ul>
|
||||
<div>Sortmy.games</div>
|
||||
<div>Hugo Meissner</div>
|
||||
<div>Benoit Leger-Derville</div>
|
||||
<div>Thomas Funk</div>
|
||||
<div>Dan Houle</div>
|
||||
<div>David Pickut</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -8,8 +8,12 @@ const propTypes = {
|
||||
defaultFlex: PropTypes.number,
|
||||
}
|
||||
|
||||
export const useFlexLayout = props => {
|
||||
PropTypes.checkPropTypes(propTypes, props, 'property', 'useFlexLayout')
|
||||
export const useFlexLayout = hooks => {
|
||||
hooks.useMain.push(useMain)
|
||||
}
|
||||
|
||||
function useMain(instance) {
|
||||
PropTypes.checkPropTypes(propTypes, instance, 'property', 'useFlexLayout')
|
||||
|
||||
const {
|
||||
defaultFlex = 1,
|
||||
@@ -20,7 +24,7 @@ export const useFlexLayout = props => {
|
||||
getHeaderProps,
|
||||
getCellProps,
|
||||
},
|
||||
} = props
|
||||
} = instance
|
||||
|
||||
columnsHooks.push((columns, api) => {
|
||||
const visibleColumns = columns.filter(column => column.visible)
|
||||
@@ -80,7 +84,7 @@ export const useFlexLayout = props => {
|
||||
return columns
|
||||
})
|
||||
|
||||
return props
|
||||
return instance
|
||||
}
|
||||
|
||||
// Utils
|
||||
|
||||
Reference in New Issue
Block a user