"use strict";
/**
 * Copyright (c) Haiku 2016-2018. All rights reserved.
 */
Object.defineProperty(exports, "__esModule", { value: true });
var getFlexId_1 = require("./getFlexId");
function shouldElementBeReplaced(domElement, virtualElement, component) {
    var oldFlexId = getFlexId_1.default(domElement);
    var newFlexId = getFlexId_1.default(virtualElement);
    if (oldFlexId && newFlexId) {
        if (oldFlexId !== newFlexId) {
            return true;
        }
    }
    if (domElement.haiku && domElement.haiku.component) {
        // If the element carried at this node has a different host component,
        // we should do a full replacement, since the cache of the two instances
        // are different and may result in different (cached) rendering output
        if (domElement.haiku.component !== component) {
            return true;
        }
    }
    return false;
}
exports.default = shouldElementBeReplaced;
//# sourceMappingURL=shouldElementBeReplaced.js.map