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.
babel-plugin-react-hooks-debug-value
Advanced tools
Babel plugin to give React Hooks a label in DevTools
Babel plugin to give React Hooks a label in DevTools.
With this plugin, it's clear in React DevTools which hook values correspond to which variables.
This is intended for development only.
Suppose you have this code:
const MyComp = () => {
const [myState, setMyState] = useState(1);
const [otherState, setOtherState] = React.useState(2);
return <Ok />
}
You'll now see this:
Instead of this:
`
since the code is transformed into this:
const useDebugValue2 = (...args) => {
React.useDebugValue("otherState");
return React.useState(...args);
};
const useDebugValue1 = (...args) => {
React.useDebugValue("myState");
return useState(...args);
};
const MyComp = () => {
const [myState, setMyState] = useDebugValue1(1);
const [otherState, setOtherState] = useDebugValue2(2);
return React.createElement(Ok, null);
};
npm add -D babel-plugin-react-hooks-debug-value
In your Babel config (scoping to your dev build somehow):
module.exports = {
plugins: ['babel-plugin-react-hooks-debug-value']
}
FAQs
Babel plugin to give React Hooks a label in DevTools
We found that babel-plugin-react-hooks-debug-value 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.