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 support for ReadonlyArray in table #29080

Closed
wants to merge 1 commit into from

Conversation

xiaoxiangmoe
Copy link

@xiaoxiangmoe xiaoxiangmoe commented Jan 27, 2021

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

react-component/table#574

💡 Background and solution

Our data types are immutable and we can't use table unless we use .slice() to clone data and convert it to mutable array.

<Table dataSource={myImmutableArray.slice()} />

But the implementation of table does not rely on mutable array, it should be immutable.

So I change the props types of table to immutable array such that I can use

<Table dataSource={myImmutableArray} />

📝 Changelog

Language Changelog
🇺🇸 English add support for readonly array props in table
🇨🇳 Chinese 新增了 Table 对 readonly array 属性的支持

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@xiaoxiangmoe
Copy link
Author

xiaoxiangmoe commented Jan 27, 2021

@zombieJ 请帮忙看看,万分感谢🙏

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jan 27, 2021

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 52418d0:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Jan 27, 2021

Codecov Report

Merging #29080 (52418d0) into master (15a9947) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master    #29080   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          393       393           
  Lines         7467      7468    +1     
  Branches      2153      2153           
=========================================
+ Hits          7467      7468    +1     
Impacted Files Coverage Δ
components/table/Table.tsx 100.00% <100.00%> (ø)
...omponents/table/hooks/useFilter/FilterDropdown.tsx 100.00% <100.00%> (ø)
components/table/hooks/useFilter/index.tsx 100.00% <100.00%> (ø)
components/table/hooks/useLazyKVMap.ts 100.00% <100.00%> (ø)
components/table/hooks/usePagination.ts 100.00% <100.00%> (ø)
components/table/hooks/useSelection.tsx 100.00% <100.00%> (ø)
components/table/hooks/useSorter.tsx 100.00% <100.00%> (ø)
components/table/hooks/useTitleColumns.tsx 100.00% <100.00%> (ø)
components/table/util.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15a9947...52418d0. Read the comment docs.

@xrkffgg
Copy link
Member

xrkffgg commented Jan 28, 2021

有冲突,rebase 下最新的 master

@zombieJ
Copy link
Member

zombieJ commented Jan 28, 2021

Sorry. 没看到你这个。 。 。我在 #29084 里做了

@zombieJ zombieJ closed this Jan 28, 2021
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.

None yet

4 participants