reblend-ui
Version:
Utilities for creating robust overlay components
40 lines (39 loc) • 1.05 kB
JavaScript
;
exports.__esModule = true;
exports.default = void 0;
var Reblend = require("reblendjs");
var _useRTGTransitionProps = require("./useRTGTransitionProps");
// Normalizes Transition callbacks when nodeRef is used.
const RTGTransition = class
/* @Reblend: Transformed from function to class */
extends Reblend.Reblend {
static ELEMENT_NAME = "RTGTransition";
constructor() {
super();
}
async initState() {
const transitionProps = _useRTGTransitionProps.default.bind(this)(props);
this.state.transitionProps = transitionProps;
}
async initProps({
component: Component,
ref,
...props
}) {
this.props = {};
this.props.Component = Component;
this.props.ref = ref;
this.props = {
...this.props,
...props
};
}
async html() {
return Reblend.Reblend.construct.bind(this)(this.props.Component, {
ref: this.props.ref,
...this.state.transitionProps
});
}
};
RTGTransition.displayName = 'RTGTransition';
var _default = exports.default = RTGTransition;