Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
with-immutable-props-to-js
Advanced tools
A higher-order component for keeping Immutable objects outside your presentational components
A higher-order component for keeping Immutable objects outside your presentational components
yarn add with-immutable-props-to-js
or
npm install with-immutable-props-to-js
This library also lists react
, react-dom
, and immutable
as peer dependencies, so make sure they are installed in your project as well.
import withImmutablePropsToJS from 'with-immutable-props-to-js'
If you're not using ECMAScript modules:
const withImmutablePropsToJS = require('with-immutable-props-to-js').default
Example:
import React from 'react'
import { connect } from 'react-redux'
import withImmutablePropsToJS from 'with-immutable-props-to-js'
const MyDumbComponent = props => {
// ...
// props.objectProp is turned into a plain JavaScript object
// props.arrayProp is turn into a plain JavaScript array
}
MyDumbComponent.propTypes = {
objectProp: PropTypes.object,
arrayProp: PropTypes.array,
}
const mapStateToProps = state => ({
objectProp: mySelectorThatReturnsImmutableMap(state),
arrayProp: mySelectorThatReturnsImmutableList(state),
})
export default connect(mapStateToProps)(withImmutablePropsToJS(MyDumbComponent))
You can read about the rationale for this higher-order component here.
For information on how to contribute to this project, check out the contributing guide.
Thanks goes to these wonderful people (emoji key):
Michael Rose 💻 📖 🚇 | Brandon Baksh 🚇 | greenkeeper[bot] 🚇 | Jake Bolam 📖 🚇 | Sanchit Gera 📖 | Siavash Mahmoudian 🚇 | monicamm95 🎨 |
Danilo Matamoros 💻 | Roman Mahotskyi 🚇 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Special thanks to Carol Skelly for donating the 'tophat' GitHub organization.
FAQs
A higher-order component for keeping Immutable objects outside your presentational components
The npm package with-immutable-props-to-js receives a total of 581 weekly downloads. As such, with-immutable-props-to-js popularity was classified as not popular.
We found that with-immutable-props-to-js 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.