Skip to content

chore: standardize repository setup#1491

Open
afc163 wants to merge 4 commits into
masterfrom
codex/standardize-rc-config
Open

chore: standardize repository setup#1491
afc163 wants to merge 4 commits into
masterfrom
codex/standardize-rc-config

Conversation

@afc163

@afc163 afc163 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Redesign README with badges, scoped install usage, Ant Design ecosystem note, development checks, and release instructions.
  • Standardize rc repository config: dumi output, Vercel preview, Surge fallback, React Doctor, test-utoo workflow, CodeQL, FUNDING, tsconfig, and package scripts.
  • Move demo imports from legacy rc-* packages to @rc-component/* packages without changing component runtime behavior.

Verification

  • npm install --ignore-scripts --no-audit --loglevel=warn
  • npm run tsc
  • npm run lint (passes with existing warnings)
  • npm test
  • npm run build
  • npm run compile (passes with existing warnings)
  • npx vercel build --yes

Refs ant-design/ant-design#58514

Summary by CodeRabbit

  • 新功能
    • 新增预览、诊断相关的自动化流程,方便在提交前查看页面效果并发现问题。
  • 文档
    • 更新首页与使用说明,补充开发、发布、示例内容,并统一示例中的组件引用展示。
  • 优化
    • 调整构建与部署配置,明确输出目录并收紧相关权限设置。
  • 其他
    • 更新依赖忽略与资助配置,保持项目维护信息更简洁。

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
table Ready Ready Preview, Comment Jun 26, 2026 10:53am

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

更新了构建输出目录、路径别名和忽略规则,示例导入切换到新的表格包,并同步调整 README、首页文案、package 脚本/依赖以及 GitHub 自动化配置。

Changes

构建、示例与文档迁移

Layer / File(s) Summary
构建输出与别名
.dumirc.ts, tsconfig.json, vercel.json, vitest.config.mts, .gitignore
Dumi、TypeScript、Vercel、Vitest 和忽略规则更新为新的输出目录与路径映射。
包脚本与依赖
package.json
package.json 的描述、脚本和开发依赖列表切换到新的表格包组合。
基础示例导入
docs/examples/animation.tsx, docs/examples/caption.tsx, docs/examples/childrenIndent.tsx, docs/examples/click-summary-row.tsx, docs/examples/colspan-rowspan*.tsx, docs/examples/column-resize.tsx, docs/examples/components.tsx, docs/examples/expandIcon.tsx, docs/examples/expandedRowRender.tsx, docs/examples/fixedColumns-auto-height.tsx, docs/examples/fixedColumnsAndHeader*.tsx, docs/examples/grouping-columns.tsx, docs/examples/hide-header.tsx, docs/examples/hover-perf.tsx, docs/examples/jsx.tsx, docs/examples/key.tsx, docs/examples/no-data.tsx, docs/examples/rowAndCellClick.tsx, docs/examples/scopeCol.tsx, docs/examples/scopeRow.tsx, docs/examples/shadow.tsx, docs/examples/simple.tsx
多数基础示例将 Table 和相关类型的导入从 rc-table 切换到 @rc-component/table
布局与展示示例
docs/examples/ellipsis.tsx, docs/examples/expandedSticky.tsx, docs/examples/stickyHeader*.tsx, docs/examples/subTable.tsx, docs/examples/title-and-footer.tsx, docs/examples/virtual-list*.tsx
ellipsis、sticky、虚拟列表和 expandedSticky 示例继续切换到新包导入。
变体示例
docs/examples/className.tsx, docs/examples/fixedColumns.tsx, docs/examples/fixedColumns-resize.tsx, docs/examples/column-hidden.tsx, docs/examples/grouping-columns-hidden.tsx, docs/examples/expandedRowClassName.tsx, docs/examples/nested.tsx, docs/examples/react-dnd.tsx, docs/examples/row-hoverable.tsx, docs/examples/scroll*.tsx, docs/examples/styled-components.tsx
className、固定列、滚动、隐藏列和其它组合示例的导入路径同步更新。
特殊示例
docs/examples/aria.tsx, docs/examples/dropdown.tsx, docs/examples/ellipsis-custom-tooltip.tsx, docs/examples/measureRowRender.tsx
ARIA、下拉、tooltip 和 measureRowRender 示例保留原有行为,同时切到新包。
首页与说明文案
docs/index.md, README.md
首页 hero、README 结构和尾部说明更新为新的产品表述。

仓库自动化

Layer / File(s) Summary
依赖策略
.github/FUNDING.yml, .github/dependabot.yml
FUNDING 和 Dependabot 的资助与忽略规则更新为新的依赖名称。
工作流更新
.github/workflows/codeql.yml, .github/workflows/main.yml, .github/workflows/react-doctor.yml, .github/workflows/surge-preview.yml
CodeQL、测试、react-doctor 和 Surge Preview 工作流更新了触发条件、权限、固定引用和执行步骤。

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • zombieJ

Poem

🐰 我跳进 docs-dist 的晨光里,
新表格包像胡萝卜一样亮晶晶。
README 翻页,首页也换了新名号,
CI 小铃铛一响,预览就轻轻登场。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题概括了仓库配置标准化、文档和工具链更新的主要变化,与本次变更一致。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/standardize-rc-config

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

.dumirc.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

docs/examples/animation.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

docs/examples/aria.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 47 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@socket-security

socket-security Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​rc-component/​dropdown@​1.0.29910010085100
Addednpm/​@​rc-component/​tooltip@​1.4.010010010088100
Addednpm/​@​rc-component/​menu@​1.4.19910010095100

View full report

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

✅ Preview is ready!

PR preview ✅ Ready ✅ Ready
🔗 Preview https://react-component-table-preview-pr-1491.surge.sh
📝 Commitcd0a3b2
⏱️ Build time21.226s
📦 Size2.9 MB (no change) · 226 files
🪵 LogsView logs
📱 MobileScan to open preview on mobile

↩️ Previous: ⚡️ cd0a3b2 · react-component-table-preview-pr-1491.surge.sh (open ↗) · 2026-06-26 10:54:22 UTC

🤖 Powered by surge-preview

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the repository and its examples from the legacy rc-table and related rc- packages to the scoped @rc-component/table, @rc-component/menu, @rc-component/dropdown, and @rc-component/tooltip packages. It also updates configuration files (such as .dumirc.ts, tsconfig.json, package.json, and vercel.json) to support the new build and documentation output directory (docs-dist). The reviewer recommends using __dirname with path.resolve in .dumirc.ts to ensure robust path resolution across different execution environments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .dumirc.ts Outdated
Comment on lines 6 to 12
'@rc-component/table$': path.resolve('src'),
'@rc-component/table/es': path.resolve('src'),
'@rc-component/dropdown/assets': path.resolve('node_modules/@rc-component/dropdown/assets'),
'@rc-component/menu/assets': path.resolve('node_modules/@rc-component/menu/assets'),
'@rc-component/tooltip/assets': path.resolve('node_modules/@rc-component/tooltip/assets'),
'rc-table$': path.resolve('src'),
'rc-table/es': path.resolve('src'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using path.resolve with relative paths depends on the current working directory (process.cwd()), which can lead to resolution failures if the dumi commands are executed from a different directory (for example, in a monorepo root). It is safer and more robust to use __dirname to ensure paths are resolved relative to the configuration file's location.

Suggested change
'@rc-component/table$': path.resolve('src'),
'@rc-component/table/es': path.resolve('src'),
'@rc-component/dropdown/assets': path.resolve('node_modules/@rc-component/dropdown/assets'),
'@rc-component/menu/assets': path.resolve('node_modules/@rc-component/menu/assets'),
'@rc-component/tooltip/assets': path.resolve('node_modules/@rc-component/tooltip/assets'),
'rc-table$': path.resolve('src'),
'rc-table/es': path.resolve('src'),
'@rc-component/table$': path.resolve(__dirname, 'src'),
'@rc-component/table/es': path.resolve(__dirname, 'src'),
'@rc-component/dropdown/assets': path.resolve(__dirname, 'node_modules/@rc-component/dropdown/assets'),
'@rc-component/menu/assets': path.resolve(__dirname, 'node_modules/@rc-component/menu/assets'),
'@rc-component/tooltip/assets': path.resolve(__dirname, 'node_modules/@rc-component/tooltip/assets'),
'rc-table$': path.resolve(__dirname, 'src'),
'rc-table/es': path.resolve(__dirname, 'src'),

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

React Doctor found 27 issues in 23 files · 1 error & 26 warnings · score 48 / 100 (Critical) · vs master

Errors

26 warnings

docs/examples/animation.tsx

  • ⚠️ L59 Anchor used as a button anchor-is-valid

docs/examples/childrenIndent.tsx

  • ⚠️ L23 Anchor used as a button anchor-is-valid

docs/examples/className.tsx

  • ⚠️ L34 Anchor used as a button anchor-is-valid

docs/examples/colspan-rowspan-legacy.tsx

  • ⚠️ L29 Anchor used as a button anchor-is-valid
  • ⚠️ L128 Anchor used as a button anchor-is-valid

docs/examples/colspan-rowspan.tsx

  • ⚠️ L23 Anchor used as a button anchor-is-valid
  • ⚠️ L102 Anchor used as a button anchor-is-valid

docs/examples/column-resize.tsx

  • ⚠️ L45 Anchor used as a button anchor-is-valid

docs/examples/dropdown.tsx

  • ⚠️ L87 Anchor used as a button anchor-is-valid

docs/examples/ellipsis-custom-tooltip.tsx

  • ⚠️ L51 Anchor used as a button anchor-is-valid

docs/examples/ellipsis.tsx

  • ⚠️ L22 Anchor used as a button anchor-is-valid

docs/examples/expandIcon.tsx

  • ⚠️ L25 Anchor used as a button anchor-is-valid

docs/examples/expandedRowRender.tsx

  • ⚠️ L51 Anchor used as a button anchor-is-valid

docs/examples/fixedColumnsAndHeader.tsx

  • ⚠️ L58 Anchor used as a button anchor-is-valid

docs/examples/hide-header.tsx

  • ⚠️ L15 Anchor used as a button anchor-is-valid

docs/examples/jsx.tsx

  • ⚠️ L22 Anchor used as a button anchor-is-valid

docs/examples/key.tsx

  • ⚠️ L51 Anchor used as a button anchor-is-valid

docs/examples/no-data.tsx

  • ⚠️ L14 Anchor used as a button anchor-is-valid

docs/examples/react-dnd.tsx

  • ⚠️ L127 Anchor used as a button anchor-is-valid

docs/examples/scrollY.tsx

  • ⚠️ L29 Anchor used as a button anchor-is-valid
  • ⚠️ L36 Anchor used as a button anchor-is-valid

docs/examples/stickyHeader.tsx

  • ⚠️ L68 preventDefault on a form or link no-prevent-default
  • ⚠️ L68 Anchor used as a button anchor-is-valid

docs/examples/styled-components.tsx

  • ⚠️ L16 Anchor used as a button anchor-is-valid

docs/examples/subTable.tsx

  • ⚠️ L64 Anchor used as a button anchor-is-valid

docs/examples/title-and-footer.tsx

  • ⚠️ L40 Anchor used as a button anchor-is-valid

Reviewed by React Doctor for commit cd0a3b2. See inline comments for fixes.

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.21%. Comparing base (b611eb2) to head (cd0a3b2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1491      +/-   ##
==========================================
+ Coverage   96.10%   99.21%   +3.11%     
==========================================
  Files          57       49       -8     
  Lines        3442     3325     -117     
  Branches      639      630       -9     
==========================================
- Hits         3308     3299       -9     
+ Misses        129       26     -103     
+ Partials        5        0       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/codeql.yml:
- Around line 27-43: The CodeQL workflow is pinned to an older fixed commit for
github/codeql-action in Initialize CodeQL, Autobuild, and Perform CodeQL
Analysis; update those action references to the latest stable v4 release and
keep them pinned to the corresponding official commit SHA. Use the
github/codeql-action entries in the workflow as the places to change, and make
sure all three steps stay on the same updated SHA for consistency.

In `@docs/examples/stickyHeaderAndSummary.tsx`:
- Line 3: 示例里的默认导入 Table 上没有挂载 Summary,导致 Table.Summary、Table.Summary.Row 和
Table.Summary.Cell 运行时为 undefined;请在 stickyHeaderAndSummary.tsx 中改用命名导入的
Summary(以及需要的话 Column/ColumnGroup),并把所有 Table.Summary
相关引用替换为该命名成员,或者如果要保留默认导入用法,则在 src/index.ts 中把 Summary 显式挂到默认导出的 Table 对象上。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8ffe63fb-b76a-408e-b18c-57dc3b7d2eee

📥 Commits

Reviewing files that changed from the base of the PR and between b611eb2 and cd0a3b2.

📒 Files selected for processing (63)
  • .dumirc.ts
  • .github/FUNDING.yml
  • .github/dependabot.yml
  • .github/workflows/codeql.yml
  • .github/workflows/main.yml
  • .github/workflows/react-doctor.yml
  • .github/workflows/surge-preview.yml
  • .gitignore
  • README.md
  • docs/examples/animation.tsx
  • docs/examples/aria.tsx
  • docs/examples/caption.tsx
  • docs/examples/childrenIndent.tsx
  • docs/examples/className.tsx
  • docs/examples/click-summary-row.tsx
  • docs/examples/colspan-rowspan-legacy.tsx
  • docs/examples/colspan-rowspan.tsx
  • docs/examples/column-hidden.tsx
  • docs/examples/column-resize.tsx
  • docs/examples/components.tsx
  • docs/examples/dropdown.tsx
  • docs/examples/ellipsis-custom-tooltip.tsx
  • docs/examples/ellipsis.tsx
  • docs/examples/expandIcon.tsx
  • docs/examples/expandedRowClassName.tsx
  • docs/examples/expandedRowRender.tsx
  • docs/examples/expandedSticky.tsx
  • docs/examples/fixedColumns-auto-height.tsx
  • docs/examples/fixedColumns-resize.tsx
  • docs/examples/fixedColumns.tsx
  • docs/examples/fixedColumnsAndHeader.tsx
  • docs/examples/fixedColumnsAndHeaderRtl.tsx
  • docs/examples/grouping-columns-hidden.tsx
  • docs/examples/grouping-columns.tsx
  • docs/examples/hide-header.tsx
  • docs/examples/hover-perf.tsx
  • docs/examples/jsx.tsx
  • docs/examples/key.tsx
  • docs/examples/measureRowRender.tsx
  • docs/examples/nested.tsx
  • docs/examples/no-data.tsx
  • docs/examples/react-dnd.tsx
  • docs/examples/row-hoverable.tsx
  • docs/examples/rowAndCellClick.tsx
  • docs/examples/scopeCol.tsx
  • docs/examples/scopeRow.tsx
  • docs/examples/scrollX.tsx
  • docs/examples/scrollXY.tsx
  • docs/examples/scrollY.tsx
  • docs/examples/shadow.tsx
  • docs/examples/simple.tsx
  • docs/examples/stickyHeader.tsx
  • docs/examples/stickyHeaderAndSummary.tsx
  • docs/examples/styled-components.tsx
  • docs/examples/subTable.tsx
  • docs/examples/title-and-footer.tsx
  • docs/examples/virtual-list-grid.tsx
  • docs/examples/virtual-list.tsx
  • docs/index.md
  • package.json
  • tsconfig.json
  • vercel.json
  • vitest.config.mts

Comment on lines +27 to +43
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@411bbbe57033eedfc1a82d68c01345aa96c737d7
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@411bbbe57033eedfc1a82d68c01345aa96c737d7

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@411bbbe57033eedfc1a82d68c01345aa96c737d7
with:
category: "/language:${{ matrix.language }}"
category: '/language:${{ matrix.language }}'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 验证固定的 action SHA 对应的标签/发布
for repo in actions/checkout github/codeql-action; do
  echo "== $repo =="
done
gh api repos/actions/checkout/commits/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 --jq '.commit.message' 2>/dev/null
gh api "repos/actions/checkout/git/refs/tags" --jq '.[] | select(.object.sha=="9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0") | .ref' 2>/dev/null
gh api repos/github/codeql-action/commits/411bbbe57033eedfc1a82d68c01345aa96c737d7 --jq '.commit.message' 2>/dev/null

Repository: react-component/table

Length of output: 442


🏁 Script executed:

#!/bin/bash
# 查询 github/codeql-action 的 tags 并查找匹配前缀 411bbbe 的引用
gh api "repos/github/codeql-action/git/refs/tags" --jq '.[] | select(.ref | contains("v")) | {tag: .ref, sha: .object.sha}' | \
  grep "411bbbe57033eedfc1a82d68c01345aa96c737d7" || echo "No tag found matching that SHA"
# 同时列出 codeql-action 的最近 5 个 tag 和对应 SHA,便于人工核对
gh api "repos/github/codeql-action/releases" --jq '.[:5] | .[] | {tag_name: .tag_name, commit_sha: .commit.sha, name: .name}'

Repository: react-component/table

Length of output: 549


更新 CodeQL Action 至最新稳定版本并保持 SHA 固定。

已确认 actions/checkout 的 SHA 9c091bb... 对应官方发布标签 v7github/codeql-action 的 SHA 411bbbe... 对应标签 v4,两者均为正式发布版本,供应链安全实践正确。然而,github/codeql-action 当前固定在 v4 初始版本,建议升级至最新稳定版(如 v4.36.x)以获取最新安全规则和修复。请使用最新稳定版的 commit SHA 并固定,例如参考 GitHub 官方仓库最新 release 确定的 SHA。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/codeql.yml around lines 27 - 43, The CodeQL workflow is
pinned to an older fixed commit for github/codeql-action in Initialize CodeQL,
Autobuild, and Perform CodeQL Analysis; update those action references to the
latest stable v4 release and keep them pinned to the corresponding official
commit SHA. Use the github/codeql-action entries in the workflow as the places
to change, and make sure all three steps stay on the same updated SHA for
consistency.

/* eslint-disable no-console,func-names,react/no-multi-comp, no-nested-ternary */
import React from 'react';
import Table from 'rc-table';
import Table from '@rc-component/table';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 验证默认导出是否附带 Summary/Summary.Row/Summary.Cell 静态成员
rg -nP '\bTable\.(Summary|EXPAND_COLUMN|Column|ColumnGroup)\b' node_modules/@rc-component/table 2>/dev/null | head
rg -nP 'Summary(\.Row|\.Cell|\s*=)' node_modules/@rc-component/table/lib/index* node_modules/@rc-component/table/es/index* 2>/dev/null | head

Repository: react-component/table

Length of output: 159


🏁 Script executed:

#!/bin/bash
# Confirm repo structure and find source entry point
ls -la
find . -maxdepth 2 -name "index.ts" -o -name "index.tsx" -o -name "index.js" | head -20

Repository: react-component/table

Length of output: 2113


🏁 Script executed:

#!/bin/bash
# Inspect the main entry point to see how Table and Summary are exported
cat -n src/index.ts

Repository: react-component/table

Length of output: 1639


🏁 Script executed:

#!/bin/bash
# Check the example file to confirm the usage pattern that fails
cat -n docs/examples/stickyHeaderAndSummary.tsx | head -110

Repository: react-component/table

Length of output: 4080


示例代码中的 Table.Summary 等静态成员在运行时将为 undefined

当前 src/index.ts 仅将 Summary 作为命名导出(named export),并未将其挂载到默认导出的 Table 对象上。
示例文件 docs/examples/stickyHeaderAndSummary.tsx (第 3 行) 使用默认导入 import Table from '@rc-component/table',随后在第 92-105 行调用 Table.SummaryTable.Summary.RowTable.Summary.Cell
由于 Table 对象上不存在 Summary 属性,此代码在运行时会报错。

建议修复方案二选一:

  1. 修改示例导入(推荐):改为使用命名导入,例如 import { default as Table, Summary } from '@rc-component/table'; 并在代码中将 Table.Summary 替换为 Summary 等。
  2. 修改库导出:若库设计意图是支持静态成员访问,需在 src/index.ts 中显式添加 Table.Summary = Summary; (以及 Column, ColumnGroup 等) 后再导出默认值。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/examples/stickyHeaderAndSummary.tsx` at line 3, 示例里的默认导入 Table 上没有挂载
Summary,导致 Table.Summary、Table.Summary.Row 和 Table.Summary.Cell 运行时为
undefined;请在 stickyHeaderAndSummary.tsx 中改用命名导入的 Summary(以及需要的话
Column/ColumnGroup),并把所有 Table.Summary 相关引用替换为该命名成员,或者如果要保留默认导入用法,则在
src/index.ts 中把 Summary 显式挂到默认导出的 Table 对象上。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant