canUpdate

Invoked before the update process.

Parameters

  • prev: object The previous component state.

Returns

boolean True if the component should update its state.

Example

const Example = new class extends Component {
    created() {
        this.update({});
    }
    canUpdate() {
        return false;
    }
    updating() {
        console.log("This life cycle method will never fire.");
    }
}();

Example.mound(document.getElementById("root");

Last updated