diff --git a/React/Views/RCTRootShadowView.m b/React/Views/RCTRootShadowView.m index b23914d25cac4a..e012358966aa37 100644 --- a/React/Views/RCTRootShadowView.m +++ b/React/Views/RCTRootShadowView.m @@ -7,10 +7,26 @@ * of patent rights can be found in the PATENTS file in the same directory. */ +#import "RCTI18nUtil.h" #import "RCTRootShadowView.h" @implementation RCTRootShadowView +/** + * Init the RCTRootShadowView with RTL status. + * Returns a RTL CSS layout if isRTL is true (Default is LTR CSS layout). + */ +- (instancetype)init +{ + self = [super init]; + if (self) { + if ([[RCTI18nUtil sharedInstance] isRTL]) { + self.cssNode->style.direction = CSS_DIRECTION_RTL; + } + } + return self; +} + - (void)applySizeConstraints { switch (_sizeFlexibility) {