Mitch Tal
Mitch Tal

Reputation: 49

React Native : force flexbox direction

Flexbox general question here,

I know FlexDirection is based on the device's default direction settings.

I was just wondering if there's a way to force the Flexbox direction as flexDirection: 'row' for example, to be LTR for all devices?

Thank you.

Upvotes: 0

Views: 156

Answers (1)

FnH
FnH

Reputation: 757

React does not provide anything to override default style. If you want to achieve that you’ll have to create a custom view and use that instead.

// @Component/View.js

import { View } from "react-native";

export default ({ style, ...props }) => <View {...props} style = {{ flexDirection: 'row', ...style }} />

Upvotes: 1

Related Questions