react-in-viewport
Advanced tools
Comparing version 1.0.0-alpha.23 to 1.0.0-alpha.24
@@ -16,2 +16,6 @@ "use strict"; | ||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
var PageTitle = /*#__PURE__*/(0, _react.memo)(function (_ref) { | ||
@@ -46,21 +50,36 @@ var _ref$title = _ref.title, | ||
PageTitle.displayName = 'PageTitle'; | ||
var Card = /*#__PURE__*/(0, _react.memo)(function (_ref2) { | ||
var titleText = _ref2.titleText, | ||
contentNode = _ref2.contentNode, | ||
forwardedRef = _ref2.forwardedRef; | ||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", { | ||
className: "card", | ||
ref: forwardedRef, | ||
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", { | ||
className: "card__head", | ||
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", { | ||
className: "card__title", | ||
children: titleText | ||
}) | ||
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", { | ||
className: "card__conent", | ||
children: contentNode | ||
})] | ||
}); | ||
}); | ||
var Card = /*#__PURE__*/function (_React$PureComponent) { | ||
_inheritsLoose(Card, _React$PureComponent); | ||
function Card() { | ||
return _React$PureComponent.apply(this, arguments) || this; | ||
} | ||
var _proto = Card.prototype; | ||
_proto.render = function render() { | ||
var _this$props = this.props, | ||
titleText = _this$props.titleText, | ||
contentNode = _this$props.contentNode, | ||
forwardedRef = _this$props.forwardedRef; | ||
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", { | ||
className: "card", | ||
ref: forwardedRef, | ||
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", { | ||
className: "card__head", | ||
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", { | ||
className: "card__title", | ||
children: titleText | ||
}) | ||
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", { | ||
className: "card__conent", | ||
children: contentNode | ||
})] | ||
}); | ||
}; | ||
return Card; | ||
}(_react["default"].PureComponent); | ||
exports.Card = Card; | ||
@@ -67,0 +86,0 @@ Card.displayName = 'Card'; |
/// <reference types="react" /> | ||
import hoistNonReactStatic from 'hoist-non-react-statics'; | ||
import type { Config, Props, Options } from './types'; | ||
declare function handleViewport(TargetComponent: React.ElementType, options?: Options, config?: Config): { | ||
declare function handleViewport(TargetComponent: React.ElementType | React.ComponentClass, options?: Options, config?: Config): { | ||
({ onEnterViewport, onLeaveViewport, ...restProps }: Props): JSX.Element; | ||
@@ -6,0 +6,0 @@ displayName: string; |
{ | ||
"name": "react-in-viewport", | ||
"version": "1.0.0-alpha.23", | ||
"version": "1.0.0-alpha.24", | ||
"description": "Track React component in viewport using Intersection Observer API", | ||
@@ -5,0 +5,0 @@ "author": "Roderick Hsiao <roderickhsiao@gmail.com>", |
91722
1725