Skip to content

Commit

Permalink
Updated the syntax to use Object.assign directly instead of referencing
Browse files Browse the repository at this point in the history
it from the react library
  • Loading branch information
jnrepo committed Sep 14, 2016
1 parent 2fddcf4 commit f033b82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
8 changes: 3 additions & 5 deletions ScrollBlocker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/** @jsx React.DOM */
var React = require('react');
var assign = require('react/lib/Object.assign');

var blockerStyle = {
pointerEvents: 'none'
Expand All @@ -21,14 +19,14 @@ var ScrollBlocker = React.createClass({displayName: "ScrollBlocker",
},

render: function () {
var { style, active, ...other } = this.props;
var $__0= this.props,style=$__0.style,active=$__0.active,other=(function(source, exclusion) {var rest = {};var hasOwn = Object.prototype.hasOwnProperty;if (source == null) {throw new TypeError();}for (var key in source) {if (hasOwn.call(source, key) && !hasOwn.call(exclusion, key)) {rest[key] = source[key];}}return rest;})($__0,{style:1,active:1});

return (
React.createElement("div", React.__spread({}, other, {style: assign({}, style, active && blockerStyle)}),
React.createElement("div", React.__spread({}, other, {style: Object.assign({}, style, active && blockerStyle)}),
this.props.children
)
);
}
});

module.exports = ScrollBlocker;
module.exports = ScrollBlocker;
6 changes: 2 additions & 4 deletions jsx/ScrollBlocker.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/** @jsx React.DOM */
var React = require('react');
var assign = require('react/lib/Object.assign');

var blockerStyle = {
pointerEvents: 'none'
Expand All @@ -24,11 +22,11 @@ var ScrollBlocker = React.createClass({
var { style, active, ...other } = this.props;

return (
<div {...other} style={assign({}, style, active && blockerStyle)}>
<div {...other} style={Object.assign({}, style, active && blockerStyle)}>
{this.props.children}
</div>
);
}
});

module.exports = ScrollBlocker;
module.exports = ScrollBlocker;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "react-scroll-components",
"version": "0.2.1",
"version": "0.2.2",
"description": "A set of components that react to page scrolling",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"prepublish": "./node_modules/react-tools/bin/jsx -x jsx ./jsx ."
"prepublish": "./node_modules/react-tools/bin/jsx --harmony -x jsx ./jsx ."
},
"repository": {
"type": "git",
Expand Down

0 comments on commit f033b82

Please sign in to comment.