react-native-navigation的迁移库

Element

context

context (any)


props

props (Readonly<object> & Readonly<object>)


refs

refs (object)


state

state (Readonly<any>)


render

render(): Element

source


setState

setState(state: function | S | object, callback: function): void

source


forceUpdate

forceUpdate(callBack: function): void

source


componentDidMount

componentDidMount(): void

source

Called immediately after a compoment is mounted. Setting state here will trigger re-rendering.


shouldComponentUpdate

shouldComponentUpdate(nextProps: Readonly<object>, nextState: Readonly<any>, nextContext: any): boolean

source

Called to determine whether the change in props and state should trigger a re-render.


componentWillUnmount

componentWillUnmount(): void

source

Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.


componentDidCatch

componentDidCatch(error: Error, errorInfo: ErrorInfo): void

source

Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.


getSnapshotBeforeUpdate

getSnapshotBeforeUpdate(prevProps: Readonly<object>, prevState: Readonly<any>): SS | null

source

Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.


componentDidUpdate

componentDidUpdate(prevProps: Readonly<object>, prevState: Readonly<any>, snapshot: SS): void

source

Called immediately after updating occurs. Not called for the initial render.


componentWillMount

componentWillMount(): void

source

Called immediately before mounting occurs, and before Component#render. Avoid introducing any side-effects or subscriptions in this method.


UNSAFE_componentWillMount

UNSAFE_componentWillMount(): void

source

Called immediately before mounting occurs, and before Component#render. Avoid introducing any side-effects or subscriptions in this method.


componentWillReceiveProps

componentWillReceiveProps(nextProps: Readonly<object>, nextContext: any): void

source

Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.


UNSAFE_componentWillReceiveProps

UNSAFE_componentWillReceiveProps(nextProps: Readonly<object>, nextContext: any): void

source

Called when the component may be receiving new props. React may call this even if props have not changed, so be sure to compare new and existing props if you only want to handle changes.


componentWillUpdate

componentWillUpdate(nextProps: Readonly<object>, nextState: Readonly<any>, nextContext: any): void

source

Called immediately before rendering when new props or state is received. Not called for the initial render.


UNSAFE_componentWillUpdate

UNSAFE_componentWillUpdate(nextProps: Readonly<object>, nextState: Readonly<any>, nextContext: any): void

source

Called immediately before rendering when new props or state is received. Not called for the initial render.