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

changed import type to common import #43501

Merged
merged 3 commits into from Jul 12, 2023

Conversation

VovkaGoodwin
Copy link
Contributor

@VovkaGoodwin VovkaGoodwin commented Jul 12, 2023

[中文版模板 / 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
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

When transferring the context to a separate file, the type export was used, not the usual export.

📝 Changelog

Language Changelog
🇺🇸 English Changed the export type to normal export
🇨🇳 Chinese 将导出类型更改为正常导出

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • 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

🚀 Summary

🤖 Generated by Copilot at 0ba58f5

Refactor Space component and its context to improve consistency and performance. Change SpaceContext from a type export to a named export in components/space/index.tsx.

🔍 Walkthrough

🤖 Generated by Copilot at 0ba58f5

  • Refactor Space component to use React.Children.toArray and React.cloneElement instead of custom logic to handle children and gaps (- - - - - - - - - - - - - - -F0L

@stackblitz
Copy link

stackblitz bot commented Jul 12, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 12, 2023

@codecov
Copy link

codecov bot commented Jul 12, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (8a7f8d0) 100.00% compared to head (48b7b0a) 100.00%.

❗ Current head 48b7b0a differs from pull request most recent head c1cc853. Consider uploading reports for the commit c1cc853 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##            master    #43501   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          657       657           
  Lines        11045     11045           
  Branches      2989      2989           
=========================================
  Hits         11045     11045           
Impacted Files Coverage Δ
components/space/index.tsx 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@afc163
Copy link
Member

afc163 commented Jul 12, 2023

原因是啥?

@VovkaGoodwin
Copy link
Contributor Author

原因是啥?

Exporting a context object as a type is wrong, it will not be possible to use it in React.useContext because of this.

@li-jia-nan li-jia-nan merged commit c683c50 into ant-design:master Jul 12, 2023
13 of 14 checks passed
@li-jia-nan
Copy link
Member

原因是啥?

看了一下这个没啥问题,SpaceContextReact.createContext 的返回值,并不是一个类型

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

3 participants