@reach/rect
Advanced tools
Comparing version 0.17.0 to 0.18.0-pre.0
{ | ||
"name": "@reach/rect", | ||
"version": "0.17.0", | ||
"version": "0.18.0-pre.0", | ||
"description": "Measure React elements position in the DOM", | ||
@@ -17,10 +17,11 @@ "author": "React Training <hello@reacttraining.com>", | ||
"@reach/observe-rect": "1.2.0", | ||
"@reach/utils": "0.17.0", | ||
"prop-types": "^15.7.2", | ||
"tiny-warning": "^1.0.3", | ||
"tslib": "^2.3.0" | ||
"@reach/utils": "0.18.0-pre.0" | ||
}, | ||
"devDependencies": { | ||
"@reach-internal/dev": "0.0.0", | ||
"@reach-internal/test": "0.0.0", | ||
"@reach-internal/tsconfig": "0.0.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2" | ||
"react-dom": "^17.0.2", | ||
"tsup": "^6.1.3" | ||
}, | ||
@@ -31,14 +32,17 @@ "peerDependencies": { | ||
}, | ||
"main": "dist/reach-rect.cjs.js", | ||
"module": "dist/reach-rect.esm.js", | ||
"types": "dist/reach-rect.cjs.d.ts", | ||
"main": "./dist/index.cjs.js", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"CHANGELOG.md", | ||
"LICENSE", | ||
"README.md", | ||
"dist" | ||
], | ||
"eslintIgnore": [ | ||
"node_modules", | ||
"dist" | ||
], | ||
"gitHead": "d206aefac2bede58c06a54b18d48eee7537096e0" | ||
} | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"module": "./dist/index.mjs", | ||
"scripts": { | ||
"build": "tsup" | ||
} | ||
} |
@@ -10,21 +10,21 @@ # @reach/rect | ||
```jsx | ||
import Rect, { useRect } from "@reach/rect"; | ||
import { Rect, useRect } from "@reach/rect"; | ||
function Example() { | ||
const ref = React.useRef(); | ||
const rect = useRect(ref); | ||
const ref = React.useRef(); | ||
const rect = useRect(ref); | ||
return ( | ||
<div> | ||
<pre>{JSON.stringify(rect, null, 2)}</pre> | ||
<div | ||
ref={ref} | ||
contentEditable | ||
dangerouslySetInnerHTML={{ | ||
__html: "Edit this to change the size!", | ||
}} | ||
/> | ||
</div> | ||
); | ||
return ( | ||
<div> | ||
<pre>{JSON.stringify(rect, null, 2)}</pre> | ||
<div | ||
ref={ref} | ||
contentEditable | ||
dangerouslySetInnerHTML={{ | ||
__html: "Edit this to change the size!", | ||
}} | ||
/> | ||
</div> | ||
); | ||
} | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24492
4
10
1
6
316
3
1
+ Added@reach/utils@0.18.0-pre.0(transitive)
- Removedprop-types@^15.7.2
- Removedtiny-warning@^1.0.3
- Removedtslib@^2.3.0
- Removed@reach/utils@0.17.0(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedtiny-warning@1.0.3(transitive)
- Removedtslib@2.7.0(transitive)
Updated@reach/utils@0.18.0-pre.0