Authored by hongyong.zhao

error catch — reviewed by hy

import App from './js/App';
// import {NativeModules} from 'react-native';
// const { YH_MarketHelper } = NativeModules;
try{
if (!__DEV__ ) {
global.ErrorUtils.setGlobalHandler((e, isFatal) => {
if(isFatal) {
let eObject = {
name: e.name,
stack: e.stack,
componentStack: e.componentStack,
message: e.message
}
console.log(eObject)
// YH_MarketHelper.reportWithPointType('UFO_BUSINESS', 'UFO_ERROR_IOS_TRACK', {
// st: JSON.stringify(eObject),
// })
}
})
}
} catch(e) {
console.log(e)
}
App('android');
... ...
import App from './js/App';
// import {NativeModules} from 'react-native';
// const { YH_MarketHelper } = NativeModules;
try{
if (!__DEV__ ) {
global.ErrorUtils.setGlobalHandler((e, isFatal) => {
if(isFatal) {
let eObject = {
name: e.name,
stack: e.stack,
componentStack: e.componentStack,
message: e.message
}
console.log(eObject)
// YH_MarketHelper.reportWithPointType('UFO_BUSINESS', 'UFO_ERROR_IOS_TRACK', {
// st: JSON.stringify(eObject),
// })
}
})
}
} catch(e) {
console.log(e)
}
App('ios');
... ...
... ... @@ -45,13 +45,13 @@ export default class Product extends Component {
this.swipeable = {};
}
componentWillReceiveProps(nextProps) {
if (this.props.data.isDeleting
&& this.props.data.isDeleting != nextProps.data.isDeleting) {
this.state.currentlyOpenSwipeable && this.state.currentlyOpenSwipeable.recenter();
this.setState({currentlyOpenSwipeable: null});
}
}
// componentWillReceiveProps(nextProps) {
// if (this.props.data.isDeleting
// && this.props.data.isDeleting != nextProps.data.isDeleting) {
// this.state.currentlyOpenSwipeable && this.state.currentlyOpenSwipeable.recenter();
// this.setState({currentlyOpenSwipeable: null});
// }
// }
handleScroll() {
const {currentlyOpenSwipeable} = this.state;
... ...