Support native RTL instead of isRTL conditional #121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You changed your native code to use
allowRTL: false
(my first commit changes that) so that the application UI is always in LTR mode, you have a property in the redux store calledisRTL
that with it you can conditionally change position of certain elements, for exampleflex-start
orflex-end
, androw
orrow-reverse
- this PR fixes the need for these and you will no longer need to do these conditionals at runtime, meaning that you no longed need the isRTL prop in most of the screens and there is no need for 'prop drilling' which will ultimately cause better performance.I added the style property
direction
to the wrappingView
in theLoading
component (which is the global wrapper to all screens). That property is conditionallyltr
orrtl
based on theisRTL
property from the store, and then you can useflexDirection: 'row'
, andalignItems: 'flex-start'
on all screens without worrying about LTR/RTL!Also when using
position: absolute
you can now usestart
andend
instead ofleft
andright
, this dynamically sets the position based on the locale and the direction, so while inRTL
-end = left, start right
, and inLTR
-end = right, start = left
.