nth-child in React-Native

The problem

The Solution

checkIndexIsEven (n) {
return n % 2 == 0;
}
<View style={[styles.option, { borderRightWidth: this.checkIndexIsEven(this.props.index) ? 3 : 0}]}>
<Text>Item</Text>
</View>

--

--

--

UK-based Technology Consultant working in London and Manchester.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Matthew Leak

Matthew Leak

UK-based Technology Consultant working in London and Manchester.

More from Medium

React Native: Initial Lessons

React Native #1

[React-Native] How to React Native work

Handle Events in React Native (Button and textInput)