Skip to content

Commit

Permalink
fix: dynamic columns
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Jul 8, 2021
1 parent 0fc0cde commit 0e55add
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ResizableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const AntdResizableHeader: React.FC<ComponentProp & any> = (props) => {

const [resizeWidth, setResizeWidth] = React.useState<number>(width);

React.useEffect(() => {
setResizeWidth(width);
}, [width]);

if (!width || Number.isNaN(Number(width))) {
return <th {...rest} style={style} className={className}></th>;
}
Expand Down

0 comments on commit 0e55add

Please sign in to comment.