"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.FadeTransition = void 0;

var _react = _interopRequireDefault(require("react"));

var _reactSpring = require("react-spring");

var FadeTransition = function FadeTransition(_ref) {
  var fromStyles = _ref.fromStyles,
      toStyles = _ref.toStyles,
      children = _ref.children;
  var transitions = (0, _reactSpring.useTransition)(children, null, {
    from: fromStyles,
    enter: toStyles,
    leave: fromStyles
  });
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, transitions.map(function (_ref2) {
    var item = _ref2.item,
        props = _ref2.props,
        key = _ref2.key;
    return item ? /*#__PURE__*/_react["default"].createElement(_reactSpring.animated.div, {
      style: props,
      key: key
    }, children) : null;
  }));
};

exports.FadeTransition = FadeTransition;
//# sourceMappingURL=index.js.map