Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dataIndex type check #1091

Merged
merged 12 commits into from
Mar 27, 2024

Conversation

crazyair
Copy link
Contributor

@crazyair crazyair commented Mar 22, 2024

Copy link

vercel bot commented Mar 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
table ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 2:47am

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.96%. Comparing base (0c74710) to head (6ce7674).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1091   +/-   ##
=======================================
  Coverage   97.96%   97.96%           
=======================================
  Files          51       51           
  Lines        4671     4671           
  Branches      592      592           
=======================================
  Hits         4576     4576           
  Misses         91       91           
  Partials        4        4           

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

@crazyair
Copy link
Contributor Author

就剩下2处了,为什么会报错?

image
image

@crazyair
Copy link
Contributor Author

crazyair commented Mar 23, 2024

就剩下2处了,为什么会报错?

第二处解决了,是因为有一处在 master 就漏掉了,没加 RecordType

@crazyair
Copy link
Contributor Author

还有的,之前本来就有错误

image

src/interface.ts Outdated Show resolved Hide resolved
@@ -40,7 +40,7 @@ export default function useCellRender<RecordType>(
? dataIndex
: [dataIndex];

const value: React.ReactNode = getValue(record, path);
const value: React.ReactNode = getValue(record, path as any);
Copy link
Member

Choose a reason for hiding this comment

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

这里为啥用 as any

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

之前的 path 是 any 类型,所以这里没报错,而现在类型是这样的

image

@zombieJ zombieJ merged commit 178fb19 into react-component:master Mar 27, 2024
9 checks passed
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.

3 participants