
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
react-responsive-mixin
Advanced tools
react-responsive-mixin makes building responsive components easy
This mixin adds method called media()
to the react component.
This is a wrapper around enquire.js
this.media(query, handler)
query
query is a media query definition either in string or object format. This mixin internally uses json2mq to convert media query from object to string format.
handler
handler is a function that needs to be executed when media query matches. handler can also be an object according to enquire.js API
var React = require('react');
var ResponsiveMixin = require('react-responsive-mixin');
var Component = React.createClass({
mixins: [ResponsiveMixin],
getInitialState: function () {
return { url: '/img/large.img' };
},
componentDidMount: function () {
this.media({maxWidth: 600}, function () {
this.setState({url: '/img/small.jpg'});
}.bind(this));
this.media({minWidth:601, maxWidth: 1024}, function () {
this.setState({url: '/img/medium.jpg'});
}.bind(this));
this.media({minWidth: 1025}, function () {
this.setState({url: '/img/large.jpg'});
}.bind(this));
},
render: function () {
return <img src={this.state.url} />;
}
});
FAQs
Mixin to develop responsive react components
The npm package react-responsive-mixin receives a total of 1,395 weekly downloads. As such, react-responsive-mixin popularity was classified as popular.
We found that react-responsive-mixin 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
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.