react-scroll-into-view
Advanced tools
Comparing version 1.7.0 to 1.8.0-alpha0
@@ -1,1 +0,1 @@ | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var React=_interopDefault(require("react")),ScrollInto=function(e){function t(){var e={behavior:r?"smooth":"instant"};s&&(e.block="start",e.inline="nearest"),document.querySelector(n).scrollIntoView(e)}var o=e.children,n=e.selector,i=e.smooth,r=void 0===i||i,l=e.style,c=void 0===l?{}:l,a=e.alignToTop,s=void 0!==a&&a,u=e.className,f=void 0===u?"":u,d=e.onClick;return React.createElement("div",{style:c,className:f,onClick:function(e){"function"==typeof d?(d(e),setTimeout(t,1e3/60)):t()}},o)};module.exports=ScrollInto; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var React=_interopDefault(require("react")),ScrollInto=function(e){var t=e.children,o=e.selector,r=e.smooth,n=void 0===r||r,l=e.style,i=void 0===l?{}:l,a=e.alignToTop,c=void 0!==a&&a,s=e.className,u=void 0===s?"":s;return React.createElement("div",{style:i,className:u,onClick:function(){var e={behavior:n?"smooth":"instant"};c&&(e.block="start",e.inline="nearest"),document.querySelector(o).scrollIntoView(e)}},t)};module.exports=ScrollInto; |
{ | ||
"name": "react-scroll-into-view", | ||
"version": "1.7.0", | ||
"version": "1.8.0-alpha0", | ||
"description": "Simple React element that when clicked scrolls to any element on page", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist/index.js" | ||
"dist/index.js", | ||
"react-scroll-into-view.d.ts" | ||
], | ||
@@ -51,3 +52,4 @@ "scripts": { | ||
"singleQuote": true | ||
} | ||
}, | ||
"types": "react-scroll-into-view.d.ts" | ||
} |
# React scroll-into-view | ||
[![Build Status](https://travis-ci.org/dominikbulaj/react-scroll-into-view.svg?branch=master)](https://travis-ci.org/dominikbulaj/react-scroll-into-view) | ||
[![npm](https://img.shields.io/npm/v/react-scroll-into-view.svg)](https://www.npmjs.com/package/react-scroll-into-view) | ||
[![bundlephobia](https://badgen.net/bundlephobia/minzip/react-scroll-into-view)](https://bundlephobia.com/result?p=react-scroll-into-view) | ||
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) | ||
Declarative way for scrolling into view any page element | ||
Fast & declarative way for scrolling to any element on page. Weights only ~450 B minified + gzipped | ||
@@ -8,0 +9,0 @@ ## Idea behind |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
5973
5
12
57
0
2