MCPcopy Create free account
hub / github.com/shoutem/ui / renderOption

Method renderOption

components/TabMenu/TabMenu.js:112–139  ·  view source on GitHub ↗
(option, key)

Source from the content-addressed store, hash-verified

110 }
111
112 renderOption(option, key) {
113 const { selectedOption } = this.props;
114
115 const isSelected = selectedOption && option.title === selectedOption.title;
116
117 return (
118 <TabMenuItem
119 key={key}
120 isSelected={isSelected}
121 item={option}
122 onItemPressed={option => this.handleOptionSelected(option)}
123 onLayoutMeasured={width => this.handleItemLayout(key, width)}
124 />
125 );
126 }
127
128 render() {
129 const { style, options } = this.props;
130
131 return (
132 <ScrollView
133 horizontal
134 contentContainerStyle={style.container}
135 onScroll={this.handleScroll}
136 onLayout={this.handleScrollLayout}
137 ref={ref => {
138 this.scroll = ref;
139 }}
140 scrollEventThrottle={16}
141 showsHorizontalScrollIndicator={false}
142 style={style.list}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected