
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
context-provider
Advanced tools
Context provider for React. Inspired from fluxible-addons-react/provideContext
.
$ npm install context-provider
babel-preset-es2015
and babel-preset-react
, babel-plugin-transform-decorators-legacy
, babel-plugin-transform-class-properties
is required.
import provideContext from 'context-provider/lib/provideContext';
import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
class Header extends Component {
static contextTypes = {
userName: PropTypes.string.isRequired
};
render() {
return (
<header>
<h1>Hello, {this.context.userName}.</h1>
</header>
);
}
}
@provideContext({
userName: PropTypes.string.isRequired
})
class App extends Component {
static contextTypes = {
userName: PropTypes.string.isRequired
};
render() {
return (
<div>
<Header />
<p>Hi! {this.context.userName}!</p>
</div>
);
}
}
ReactDOM.render(
<App context={{ userName: 'John Doe' }} />,
document.getElementById('app')
);
var provideContext = require('context-provider/lib/provideContext');
var React = require('react');
var ReactDOM = require('react-dom');
var Header = React.createClass({
contextTypes: {
userName: React.PropTypes.string.isRequired
},
render: function() {
return React.createElement(
'header',
null,
React.createElement(
'h1',
null,
'Hello, ',
this.context.userName,
'.'
)
);
}
});
var App = React.createClass({
contextTypes: {
userName: React.PropTypes.string.isRequired
},
render: function() {
return React.createElement(
'div',
null,
React.createElement(Header, null),
React.createElement(
'p',
null,
'Hi! ',
this.context.userName,
'!'
)
);
}
});
App = provideContext({
userName: React.PropTypes.string.isRequired
})(App);
ReactDOM.render(
React.createElement(App, {
context: { userName: 'John Doe' }
}),
document.getElementById('app')
);
MIT
FAQs
Context provider for React.
The npm package context-provider receives a total of 128 weekly downloads. As such, context-provider popularity was classified as not popular.
We found that context-provider 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.