You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some hooks like useCalendarGrid use the useLocale hook to fetch locale information. However if the I18nProvider is rendered (eg. as part of a parent update somewhere in the tree) even if locale stays the same it re-creates a new dictionary object forcing all child hooks to re-render (even if their parent components don't have to).
🤔 Expected Behavior?
The hook should memo the dict value to avoid causing renders down the tree or I18nContext should be exported to allow for custom adjustments to this behavior.
😯 Current Behavior
Only the provider is exported which causes this issue. It's not possible to access the context itself so it's not possible to resolve this problem in userland.
💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
Create a calendar structure as per examples wrapping it in I18nProvider somewhere close to the top of the app tree
Memo the calendar component so it doesn't update when parents do
Force a render to the app causing a re-render to the I18nProvider - observe the dict now changes reference causing re-renders everywhere its used (including inside the calendar - even if we don't change anything in it)
Version
3.32.1
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
If other, please specify.
No response
What operating system are you using?
macOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered:
Provide a general summary of the issue here
Some hooks like
useCalendarGrid
use theuseLocale
hook to fetch locale information. However if theI18nProvider
is rendered (eg. as part of a parent update somewhere in the tree) even iflocale
stays the same it re-creates a new dictionary object forcing all child hooks to re-render (even if their parent components don't have to).🤔 Expected Behavior?
The hook should memo the dict value to avoid causing renders down the tree or
I18nContext
should be exported to allow for custom adjustments to this behavior.😯 Current Behavior
Only the provider is exported which causes this issue. It's not possible to access the context itself so it's not possible to resolve this problem in userland.
💁 Possible Solution
No response
🔦 Context
No response
🖥️ Steps to Reproduce
I18nProvider
somewhere close to the top of the app treeI18nProvider
- observe the dict now changes reference causing re-renders everywhere its used (including inside the calendar - even if we don't change anything in it)Version
3.32.1
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
If other, please specify.
No response
What operating system are you using?
macOS
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: