Code Monkey home page Code Monkey logo

react-native-navigation-training's Introduction

这是一个react-native关于路由的测试

测试结果为,从homePage跳转到infoPage,homePage未销毁。 再从infoPage返回homePage时,如果props未改变,则homePage不会rerender,并且infoPage自身组件被销毁调用componentWillUnmount。 如果从infoPage返回homePage时,props发生改变,则homePage调用componentWillReceiveProps并rerender,infoPage自身同样会销毁。

总结来说就是:
  1. 从a页面push到b页面,再从b页面pop回a页面,props发生改变a页面调用componentWillReceiveProps,并不会调用componentWillMount,componentDidMount。
  2. push的时候组件不会被销毁,只有pop的时候,pop的那一方组件会被销毁。

react-native-navigation-training's People

Contributors

huangming1994 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.