React native works very slow on android

前端 未结 3 823
一整个雨季
一整个雨季 2021-01-17 16:28

By \'Very slow\' i mean, it loads a single transition about 5 second despite this is just a simple example app.

Here is the whole app RN code

Take a look at

3条回答
  •  猫巷女王i
    2021-01-17 16:52

    What version of React Native are you running? And what phone are you running it on?

    If you run React Native on an Android Emulator, it'll be pretty slow. Also, if you have chrome debugging on, it slows the app down a LOT.

    I'm running a fairly simple React Native app on my Samsung Galaxy s4 device, and it runs fairly quickly (animations run pretty smoothly too).

    some example code that I run (a sidedrawer and main view with animation):

    _renderCancel: function(){
      if (this.state.showView) {
        return (
          this.props.view
        );
      } else {
         return ;
       }
    },
    
    render: function() {
    
    var menu = ;
    
    
    return (
      
        
           
          {this._renderCancel()}   
        
      
    
    );
    },
    

    this runs fairly quickly on my device.

提交回复
热议问题