-
Notifications
You must be signed in to change notification settings - Fork 24.8k
Closed
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.
Description
for SegmentedControlIOS component,when used onChange event,the callback param event,event.nativeEvent is null,no selectedIndex attribute.
var EventSegmentedControlExample=React.createClass({ getInitialState(){ return { values:['One','Two','Three'], value:'Not selected', selectedIndex:undefined }; }, render(){ return( <View> <Text style={styles.text}> Value:{this.state.value} </Text> <Text style={styles.text}> Index:{this.state.selectedIndex} </Text> <SegmentedControlIOS values={this.state.values} selectedIndex={this.state.selectedIndex} onChange={this._onChange} onValueChange={this._onValueChange} /> </View> ); }, _onChange(event){ console.log(event);//debug console log here this.setState({ selectedIndex:event.nativeEvent.selectedIndex }); }, _onValueChange(value){ this.setState({ value:value }); } }); //render EventSegmentedControlExample //
this is console log:
_dispatchIDs: null, _dispatchListeners: null, bubbles: nullcancelable: null, currentTarget: null, defaultPrevented: null, dispatchConfig: null, dispatchMarker: null, eventPhase: null, isDefaultPrevented: function () {}, isPropagationStopped: function () {}, isTrusted: null, nativeEvent: null,//there is null target: null, timeStamp: null, type: null
the SegmentedControlIOS is a new component,is this an bug?
Metadata
Metadata
Assignees
Labels
Resolution: LockedThis issue was locked by the bot.This issue was locked by the bot.