From 30be80ac396deb5d97baf6d0806a5ef1d6b534f2 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 26 Nov 2021 14:05:59 +0800 Subject: [PATCH] Revert "fix: className doesn't work with tabPanel (#420)" (#449) This reverts commit a412700e24287ee4c0de8135c3b4ae47fdcf5b25. --- docs/examples/basic.tsx | 2 +- package.json | 3 +-- src/TabNavList/TabNode.tsx | 4 +--- src/TabNavList/index.tsx | 3 +-- tests/__snapshots__/index.test.tsx.snap | 4 ++-- tests/index.test.tsx | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/examples/basic.tsx b/docs/examples/basic.tsx index d9d9e076..c92eed9f 100644 --- a/docs/examples/basic.tsx +++ b/docs/examples/basic.tsx @@ -8,7 +8,7 @@ export default () => { Light , - + Bamboo , diff --git a/package.json b/package.json index 9556f70b..76c7acb6 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "docs:deploy": "gh-pages -d .doc", "compile": "father build && npm run compile:style", "test": "father test", - "test:update": "father test --u", "coverage": "father test --coverage", "now-build": "npm run build", "lint": "eslint src/ docs/examples/ --ext .tsx,.ts,.jsx,.js", @@ -68,7 +67,7 @@ "react-dnd": "^10.0.0", "react-dnd-html5-backend": "^10.0.0", "react-dom": "^16.0.0", - "react-router": "^5.0.0", + "react-router": "^3.0.0", "react-sticky": "^6.0.3", "react-test-renderer": "^16.0.0", "sortablejs": "^1.7.0", diff --git a/src/TabNavList/TabNode.tsx b/src/TabNavList/TabNode.tsx index 4a3101d2..b9aa7b55 100644 --- a/src/TabNavList/TabNode.tsx +++ b/src/TabNavList/TabNode.tsx @@ -18,7 +18,6 @@ export interface TabNodeProps { onRemove: () => void; onFocus: React.FocusEventHandler; style?: React.CSSProperties; - className?: string; } function TabNode( @@ -35,7 +34,6 @@ function TabNode( onRemove, onFocus, style, - className, }: TabNodeProps, ref: React.Ref, ) { @@ -65,7 +63,7 @@ function TabNode(
) { } const tabNodes: React.ReactElement[] = tabs.map((tab, i) => { - const { key, className: tabClassName } = tab; + const { key } = tab; return ( ) { tab={tab} /* first node should not have margin left */ style={i === 0 ? undefined : tabNodeStyle} - className={tabClassName} closable={tab.closable} editable={editable} active={key === activeKey} diff --git a/tests/__snapshots__/index.test.tsx.snap b/tests/__snapshots__/index.test.tsx.snap index b232b3ba..08483b9b 100644 --- a/tests/__snapshots__/index.test.tsx.snap +++ b/tests/__snapshots__/index.test.tsx.snap @@ -30,7 +30,7 @@ exports[`Tabs.Basic Normal 1`] = `
{ Light , - + Bamboo ,