Hooks

Before mount

Before drawing a DOM tree

beforeMount() {}

After mount

After drawing a DOM tree

afterMount() {}

Before unmount

Before the component is removed from the DOM tree

beforeUnmount() {}

Before update

Before dom is updated

beforeUpdate(nextProps, nextState, nextContext) {}

After update

After dom is updated

afterUpdate(prevProps, prevState, prevContext) {}

Need to update

Specifies whether to update the component. It is necessary to return:

true - the component will be updated
false - component will not be updated

By default, always true

isNeedUpdate(nextProps, nextState, nextContext) {}