Fix useResizeColumns bug

This commit is contained in:
Tanner Linsley 2019-12-10 14:58:31 -07:00
parent 08bb50ae48
commit 0c43e19091
5 changed files with 27 additions and 24 deletions

View File

@ -1,13 +1,13 @@
{ {
"dist/index.js": { "dist/index.js": {
"bundled": 108216, "bundled": 108222,
"minified": 51347, "minified": 51353,
"gzipped": 13498 "gzipped": 13489
}, },
"dist/index.es.js": { "dist/index.es.js": {
"bundled": 107373, "bundled": 107379,
"minified": 50597, "minified": 50603,
"gzipped": 13345, "gzipped": 13336,
"treeshaked": { "treeshaked": {
"rollup": { "rollup": {
"code": 80, "code": 80,

View File

@ -1,3 +1,7 @@
## 7.0.0-rc.8
- Fix an issue where `useResizeColumns` would crash when using the resizer prop getter
## 7.0.0-rc.7 ## 7.0.0-rc.7
Removed: Removed:

View File

@ -92,19 +92,18 @@ function Table({ columns, data }) {
</div> </div>
<div className="rows" {...getTableBodyProps()}> <div className="rows" {...getTableBodyProps()}>
{rows.map( {rows.map((row, i) => {
(row, i) => { prepareRow(row)
prepareRow(row); return (
return ( <div {...row.getRowProps()} className="row body">
<div {...row.getRowProps()} className="row body"> {row.cells.map((cell, index) => (
{row.cells.map((cell,index) => ( <div {...cell.getCellProps()} key={index} className="cell">
<div {...cell.getCellProps()} key={index} className="cell"> {cell.render('Cell')}
{cell.render('Cell')} </div>
</div> ))}
))} </div>
</div> )
)} })}
)}
</div> </div>
</div> </div>
) )

View File

@ -8087,10 +8087,10 @@ react-scripts@3.0.1:
optionalDependencies: optionalDependencies:
fsevents "2.0.6" fsevents "2.0.6"
react-table@next: react-table@latest:
version "7.0.0-alpha.7" version "7.0.0-rc.7"
resolved "https://registry.yarnpkg.com/react-table/-/react-table-7.0.0-alpha.7.tgz#0cb6da6f32adb397e68505b7cdd4880d15d73017" resolved "https://registry.yarnpkg.com/react-table/-/react-table-7.0.0-rc.7.tgz#1bf3e248cdef22213821c021236e895bdc3cb5d2"
integrity sha512-oXE9RRkE2CFk1OloNCSTPQ9qxOdujgkCoW5b/srbJsBog/ySkWuozBTQkxH1wGNmnSxGyTrTxJqXdXPQam7VAw== integrity sha512-24Yofwkh822NyCmnpsrChV8SNOCENQWpV4A5f/MzapTi6iwje644Q11/wbLIgJdPnUJJ0/JbhjsDjxlB6yFV7Q==
react@^16.8.6: react@^16.8.6:
version "16.8.6" version "16.8.6"

View File

@ -203,7 +203,7 @@ const useInstanceBeforeDimensions = instance => {
const getInstance = useGetLatest(instance) const getInstance = useGetLatest(instance)
const getResizerPropsHooks = useConsumeHookGetter( const getResizerPropsHooks = useConsumeHookGetter(
getInstance(), getInstance().hooks,
'getResizerProps' 'getResizerProps'
) )