diff --git a/docs/examples/animation.tsx b/docs/examples/animation.tsx index fc773559e..d0105495e 100644 --- a/docs/examples/animation.tsx +++ b/docs/examples/animation.tsx @@ -11,7 +11,7 @@ type MotionBodyProps = React.HTMLAttributes; const MotionBody: React.FC = ({ children, ...props }) => { const nodeList = toArray(children); - const nodesRef = React.useRef>({}); + const nodesRef = React.useRef>>({}); // Better apply clean up logic to avoid OOM const keys: React.Key[] = []; @@ -26,7 +26,7 @@ const MotionBody: React.FC = ({ children, ...props }) => { {({ key, className }) => { const node = nodesRef.current[key]; - return React.cloneElement(node, { + return React.cloneElement(node, { className: classNames(node.props.className, className), }); }} diff --git a/docs/examples/fixedColumnsAndHeaderRtl.tsx b/docs/examples/fixedColumnsAndHeaderRtl.tsx index 13f87219d..06cba5184 100644 --- a/docs/examples/fixedColumnsAndHeaderRtl.tsx +++ b/docs/examples/fixedColumnsAndHeaderRtl.tsx @@ -37,7 +37,7 @@ const useColumn = ( ellipsis: boolean, percentage: boolean, ) => { - const columns: ColumnsType = React.useMemo( + const columns = React.useMemo>( () => [ { title: 'title1', diff --git a/docs/examples/jsx.tsx b/docs/examples/jsx.tsx index 77b967594..5f5107e67 100644 --- a/docs/examples/jsx.tsx +++ b/docs/examples/jsx.tsx @@ -1,4 +1,3 @@ -/* eslint-disable import/no-named-as-default-member */ import React from 'react'; import Table from 'rc-table'; import '../../assets/index.less'; diff --git a/docs/examples/scrollY.tsx b/docs/examples/scrollY.tsx index 61ac68338..4146498a5 100644 --- a/docs/examples/scrollY.tsx +++ b/docs/examples/scrollY.tsx @@ -13,7 +13,7 @@ for (let i = 0; i < 20; i += 1) { } const Test = () => { - const tblRef = React.useRef(); + const tblRef = React.useRef(null); const [showBody, setShowBody] = React.useState(true); const toggleBody = () => { @@ -94,7 +94,7 @@ const Test = () => { data={data} scroll={{ y: 300 }} rowKey={record => record.key} - onRow={(record, index) => ({ style: { backgroundColor: 'red' } })} + onRow={() => ({ style: { backgroundColor: 'red' } })} />

Column align issue

https://github.com/ant-design/ant-design/issues/54889

diff --git a/docs/examples/shadow.tsx b/docs/examples/shadow.tsx index 29913ef94..9069c9f51 100644 --- a/docs/examples/shadow.tsx +++ b/docs/examples/shadow.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import type { TableProps } from 'rc-table'; import Table from 'rc-table'; import '../../assets/index.less'; import type { ColumnsType } from '@/interface'; diff --git a/docs/examples/stickyHeader.tsx b/docs/examples/stickyHeader.tsx index a004c1dba..3f602e90b 100644 --- a/docs/examples/stickyHeader.tsx +++ b/docs/examples/stickyHeader.tsx @@ -166,7 +166,7 @@ const columns3: ColumnType[] = [ ]; const Demo = () => { - const container = useRef(); + const container = useRef(null); return (

Sticky

diff --git a/docs/examples/virtual-list-grid.tsx b/docs/examples/virtual-list-grid.tsx index 9f24ca738..aee4e6d4d 100644 --- a/docs/examples/virtual-list-grid.tsx +++ b/docs/examples/virtual-list-grid.tsx @@ -23,7 +23,7 @@ for (let i = 0; i < 100000; i += 1) { }); } const Demo = () => { - const gridRef = React.useRef(); + const gridRef = React.useRef(null); const [connectObject] = React.useState(() => { const obj = {}; Object.defineProperty(obj, 'scrollLeft', { diff --git a/docs/examples/virtual-list.tsx b/docs/examples/virtual-list.tsx index 10bbad7c6..c9488ea9e 100644 --- a/docs/examples/virtual-list.tsx +++ b/docs/examples/virtual-list.tsx @@ -33,13 +33,10 @@ const Cell = ({ columnIndex, rowIndex, style }) => ( ); const Demo = () => { - const gridRef = React.useRef(); + const gridRef = React.useRef(null); React.useEffect(() => { - gridRef.current.resetAfterIndices({ - columnIndex: 0, - shouldForceUpdate: false, - }); + gridRef.current.resetAfterIndices({ columnIndex: 0, shouldForceUpdate: false }); }, []); const renderVirtualList = (rawData: object[], { scrollbarSize }: any) => ( diff --git a/docs/examples/virtual.tsx b/docs/examples/virtual.tsx index b527348b6..2510fd6e1 100644 --- a/docs/examples/virtual.tsx +++ b/docs/examples/virtual.tsx @@ -189,7 +189,7 @@ const data: RecordType[] = new Array(4 * 10000).fill(null).map((_, index) => ({ })); const Demo: React.FC = () => { - const tableRef = React.useRef(); + const tableRef = React.useRef(null); return (