react-native InteractionManager

/**

* Sample React Native App

* https://github.com/facebook/react-native

* @flow

*/

import React, { Component } from 'react';

import {

AppRegistry,

StyleSheet,

Text,

View,

InteractionManager

} from 'react-native';

export default class D20170504 extends Component {

render() {

return (

{

InteractionManager.runAfterInteractions(()=>{

console.log('last')

})

for(var a=0;a<10;a++){

console.log(a);

}

}}>

Welcome to React Native!

);

}

}

const styles = StyleSheet.create({

container: {

flex: 1,

justifyContent: 'center',

alignItems: 'center',

backgroundColor: '#F5FCFF',

},

welcome: {

fontSize: 20,

textAlign: 'center',

margin: 10,

},

instructions: {

textAlign: 'center',

color: '#333333',

marginBottom: 5,

},

});

AppRegistry.registerComponent('D20170504', () => D20170504);

你可能感兴趣的:(react-native InteractionManager)