Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
react-with-dimensions
Advanced tools
React decorator to receive dimensions props generated by ResizeObserver
React decorator to receive dimensions props generated by
ResizeObserver
.
npm install --save react-with-dimensions
Decorated component will receive an addicional dimensions
prop with all keys
defined in DOMRectReadOnly.
x
: The x coordinate of the DOMRect's originy
: The y coordinate of the DOMRect's originwidth
: The width of the DOMRectheight
: The height of the DOMRecttop
: Returns the top coordinate value of the DOMRect (usually the same as y
)right
: Returns the right coordinate value of the DOMRect (usually the same as x
+ width
)bottom
: Returns the bottom coordinate value of the DOMRect (usually the same as y
+ height
)left
: Returns the left coordinate value of the DOMRect (usually the same as x
)import React, { Component } from 'react'
import withDimensions from 'react-with-dimensions'
//
// decorator
//
@withDimensions
class Box extends Component {
render() {
<div>
<p>width: {this.props.dimensions.width}</p>
<p>height: {this.props.dimensions.height}</p>
</div>
}
}
//
// function
//
class Box extends Component {
render() {
<div>
<p>width: {this.props.dimensions.width}</p>
<p>height: {this.props.dimensions.height}</p>
</div>
}
}
const BoxWithDimensions = withDimensions(Box)
caiogondim.com · GitHub @caiogondim · Twitter @caio_gondim
FAQs
React decorator to receive dimensions props generated by ResizeObserver
The npm package react-with-dimensions receives a total of 5,281 weekly downloads. As such, react-with-dimensions popularity was classified as popular.
We found that react-with-dimensions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.