import { NativeModules, requireNativeComponent } from 'react-native';
/** * 使用 RN提供的 */ import { NativeModules, requireNativeComponent } from 'react-native'; MMRCTDatePickerView = 'MMRCTDatePickerView' in NativeModules.UIManager ? requireNativeComponent('MMRCTDatePickerView') : null; /** * 检查native是否支持supportDatePickerView */ export const supportDatePickerView = () => { if (MMRCTDatePickerView) { return true; } return false; }; /** * render View */ return ( <MMRCTDatePickerView style={props.style} data={paramStr} onItemSelected={(event: any) => { console.log('客户端时间返回=======', event?.nativeEvent?.result); onItemSelected && onItemSelected(event); }} value={value} /> );
标签:调用,return,NativeModules,MMRCTDatePickerView,ui,requireNativeComponent,客户端,native From: https://www.cnblogs.com/xiaoeshuang/p/16923658.html