@arche-mc2/arche-controls
Version:
We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get
33 lines • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = require("react");
;
;
var UpHover = (function (_super) {
tslib_1.__extends(UpHover, _super);
function UpHover() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.state = {
hover: false
};
_this.onMouseEnterHandler = function () {
_this.setState({ hover: true }, _this.onStateChange);
};
_this.onMouseLeaveHandler = function () {
_this.setState({ hover: false }, _this.onStateChange);
};
_this.onStateChange = function () {
_this.props.onHoverChange(_this.state.hover);
};
return _this;
}
UpHover.prototype.render = function () {
var children = this.props.children;
return React.createElement("div", { onMouseEnter: this.onMouseEnterHandler, onMouseLeave: this.onMouseLeaveHandler }, children);
};
return UpHover;
}(React.Component));
exports.default = UpHover;
;
//# sourceMappingURL=UpHover.js.map