react-native-material-dropdown
react-native-material-dropdown copied to clipboard
rtl support
How to rtl dropdown I used all the available options but did not work please help
You can control RTL or LTR using renderBase prop. Say you have a Row component that handles the direction
const styles = StyleSheet.create({
default: {
display: 'flex',
flexDirection: 'row', // Here you can control the direction
},
});
function Row(props) {
const style = Array.isArray(props.style) ? props.style : [props.style];
return (
<View {...props} style={[styles.default, ...style]}>
{props.children}
</View>
);
}
Then you can just use it as follows.
<Dropdown
...dropdownProps
renderBase={props => {
return (
<Row>
<Text>
{props.title}
</Text>
{props.renderAccessory() /* This part is the arrow */}
</Row>
);
}}
>