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

refactor(useLocale): make component locale overriding locale from con… #50213

Closed
wants to merge 0 commits into from

Conversation

Asanio06
Copy link
Contributor

@Asanio06 Asanio06 commented Aug 2, 2024

…text

中文版模板 / 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

Today, if I inject parameters into the locale props in my Calendar component, it doesn't take them into account if I already have a locale in my ConfigProvider. This means that I can't have a global configuration that I override for specific cases. Here some exemple : https://stackblitz.com/edit/react-o7hv5j?file=demo.tsx
You can see that if you remove ConfigProvider locale, all we work fine

📝 Changelog

  • Use a developer-oriented tone and narrative style.
  • Describe the user's first-hand experience of the issue and its impact on developers, rather than your solution approach.
  • Refer to: https://ant.design/changelog
Language Changelog
🇺🇸 English refactor(useLocale): make component locale overriding locale from context
🇨🇳 Chinese

Copy link

stackblitz bot commented Aug 2, 2024

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

Copy link
Contributor

github-actions bot commented Aug 2, 2024

Prepare preview

Copy link
Contributor

github-actions bot commented Aug 2, 2024

👁 Visual-Regression Diff Building... ⏳

This PR is under visual-regression-diff building, please wait for the result.

Copy link
Contributor

github-actions bot commented Aug 2, 2024

@afc163
Copy link
Member

afc163 commented Aug 2, 2024

Please create a online reproduce and describe what problem this PR you want to resolve?

Copy link
Member

@afc163 afc163 left a comment

Choose a reason for hiding this comment

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

Please create a online reproduce and describe what problem this PR you want to resolve?

package.json Outdated Show resolved Hide resolved
Copy link

pkg-pr-new bot commented Aug 2, 2024

@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label Aug 2, 2024
@Asanio06
Copy link
Contributor Author

Asanio06 commented Aug 3, 2024

Sorry i will make all change you talk about

@Asanio06 Asanio06 force-pushed the master branch 2 times, most recently from f25704c to 7fb7e06 Compare August 4, 2024 05:16
@Asanio06
Copy link
Contributor Author

Asanio06 commented Aug 4, 2024

Hello @afc163 , I've updated my code to be clearer and not to cause any breaking changes.
Here some exemple : https://stackblitz.com/edit/react-o7hv5j?file=demo.tsx
You can see that if you remove ConfigProvider locale, all we work fine

@Asanio06
Copy link
Contributor Author

Asanio06 commented Aug 5, 2024

I finally noticed that the problem was with Calendar and not the other components, so I opened a PR to fix it. Sorry for the inconvenience. We can close this.

@Asanio06
Copy link
Contributor Author

Asanio06 commented Aug 5, 2024

Here the new PR: #50236
Thanks you for all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants