Skip to content

Wrap checkIsResourcesReady with useMemo to optimize rendering#7934

Closed
Copilot wants to merge 2 commits intochore/i18n-pluginfrom
copilot/sub-pr-7926
Closed

Wrap checkIsResourcesReady with useMemo to optimize rendering#7934
Copilot wants to merge 2 commits intochore/i18n-pluginfrom
copilot/sub-pr-7926

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 28, 2025

Summary

Addresses review feedback on #7926 to memoize checkIsResourcesReady in useModernI18n hook.

The function was being called on every render. Now wrapped with useMemo with currentLanguage and i18nInstance as dependencies:

const isResourcesReady = useMemo(() => {
  // ... resource check logic
}, [currentLanguage, i18nInstance]);

Related Links

Checklist

  • I have added changeset via pnpm run change.
  • I have updated the documentation.
  • I have added tests to cover my changes.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Nov 28, 2025

⚠️ No Changeset found

Latest commit: 2341546

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: caohuilin <12605189+caohuilin@users.noreply.github.com>
Copilot AI changed the title [WIP] Work in progress on i18n plugin support feedback Wrap checkIsResourcesReady with useMemo to optimize rendering Nov 28, 2025
Copilot AI requested a review from caohuilin November 28, 2025 01:14
@caohuilin caohuilin closed this Nov 28, 2025
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