nk-virtual
Version:
It is just an interface or wrapper around react library.
62 lines (53 loc) • 1.55 kB
JavaScript
import * as react from "react";
import ReactDom from 'react-dom';
import PropTypes from "prop-types";
import ReactCSSTransitionGroup from "react-addons-css-transition-group";
import { createElement, Children } from "react";
class Component extends react.Component {
constructor(props) {
super(...arguments);
}
createdCallback() {}
attachedCallback() {}
detachedCallback() {}
attributeChangedCallback() {}
componentWillReceiveProps() {
this.attributeChangedCallback(...arguments);
}
componentWillMount() {
this.createdCallback(...arguments);
}
componentDidMount() {
this.attachedCallback(...arguments);
}
componentWillUnmount() {
this.detachedCallback(...arguments);
}
}
class PureComponent extends react.PureComponent {
constructor(props) {
super(...arguments);
}
createdCallback() {}
attachedCallback() {}
detachedCallback() {}
attributeChangedCallback() {}
componentWillReceiveProps() {
this.attributeChangedCallback(...arguments);
}
componentWillMount() {
this.createdCallback(...arguments);
}
componentDidMount() {
this.attachedCallback(...arguments);
}
componentWillUnmount() {
this.detachedCallback(...arguments);
}
}
const VirtualCSSTransitionGroup = ReactCSSTransitionGroup;
const Virtual = { PropTypes, createElement, Children, Component, PureComponent }
const VirtualDom = { render: ReactDom.render }
export {
Virtual, VirtualDom, PropTypes, VirtualCSSTransitionGroup
}