React Native
  • Initial page
  • Set-up
    • Prepare the environment
    • ESLint
    • Debugger
  • Introduction
    • React v.s. React Native
    • Project Tree & Script Structure
  • Component & Props
    • What is Props
    • What is Compoent
      • Axios and Component State
      • Class-base components
      • Example
        • Activity Indicator
        • Rendering Large list
        • Card
  • Styling
    • What is Styling
    • Primitive elements
    • Flexbox
      • justifyContent
      • flexDirection
    • More on styling
    • Alignment & Touchable Item
  • Redux
    • What is Redux
    • What is Reducer
  • React-thunk
    • Untitled
  • Build & Release
    • Untitled
Powered by GitBook
On this page

Was this helpful?

  1. Component & Props
  2. What is Compoent

Class-base components

PreviousAxios and Component StateNextExample

Last updated 6 years ago

Was this helpful?

Functional Component must return some amount of JSX object.

Class based components is mainly for dynamic sources of data.

Class Component has a life-cycle methods, function that placed on out class that will be automatically called at some point.

We can define a method on the class

  • componentWillMount()

  • componentDidMount()

  • componentWillReceiveProps

  • shouldComponentUpdate

  • componentWillUpdate

  • componentDidUpdate

  • componentWillUnmount

组件生命周期
React.Component - React