π html direction partially broken on initial load for RTL languages
a-tokyo opened this issue Β· comments
Description:
β After the recent changes to htmlDirection
, the initial load of the page no longer respects language direction
Screenshot of broken code:
Screenshot of working code: (happens if I change language to another language then back to an rtl language)
Proposed solution:
β In App.js we need to have an effect that runs on initial load and sets the direction for the whole App, not just settings component
Hi @a-tokyo thanks for reporting this! This was likely introduced in #168
Proposed solution:
β In App.js we need to have an effect that runs on initial load and sets the direction for the whole App, not just settings component
I agree, since App.js is responsible for the state and rendering the children (card, settings) components, that's the right place to do the initial direction setting. Right now both components are getting the majority of their state through the settings
prop, so that might be the best place to track the initial rtl
state, instead of adding a new direction
prop to both components.