Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
length: 0,
pageSize: 10,
threshold: 500
},
enumerable: true
}]);
return List;
})(_React.Component);
exports.List = List;
// asuth-hack: this is where the pure render mixin canonically lives now;
// this whole file should be rebuilt/updated/whatever, but this works for now.
List.prototype.shouldComponentUpdate =
require('react-addons-pure-render-mixin').shouldComponentUpdate;
var UniformList = (function (_List) {
function UniformList() {
_classCallCheck(this, UniformList);
if (_List != null) {
_List.apply(this, arguments);
}
this.state = {
from: 0,
itemHeight: this.props.itemHeight || 0,
itemsPerRow: this.props.itemsPerRow || 1,
size: 1
};
}
constructor(props: Props): void {
super(props);
this.shouldComponentUpdate = shouldComponentUpdate.bind(this);
this.state = {
view: true,
// HACK: We'll need to handle props and state change better here
source: this.props.cell.get('source'),
};
this.openEditor = this.openEditor.bind(this);
this.editorKeyDown = this.editorKeyDown.bind(this);
this.renderedKeyDown = this.renderedKeyDown.bind(this);
}
shouldComponentUpdate(nextProps: Props, nextState: any): boolean {
return ReactComponentWithPureRenderMixin.shouldComponentUpdate.call(
this,
nextProps,
nextState
);
}
shouldComponentUpdate(nextProps, nextState) {
return !nextProps.loading && PureRenderMixin.shouldComponentUpdate(this, nextProps, nextState);
}
constructor(props, context) {
super(props, context);
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
this.updateHandle = this.updateHandle.bind(this)
}
constructor(props, context) {
super(props, context);
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
this.state = {}
}
constructor(props, context) {
super(props, context);
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
}
render() {
constructor(...args) {
super(...args);
this.shouldComponentUpdate = shouldComponentUpdate.bind(this);
}
}
default as ReactComponentWithPureRenderMixin,
} from 'react-addons-pure-render-mixin';
import Prism from 'prismjs';
export default class Code extends Component {
static propTypes = {
className: PropTypes.string,
code: PropTypes.string,
};
componentDidMount() {
this._highlight();
}
shouldComponentUpdate = ReactComponentWithPureRenderMixin.shouldComponentUpdate;
componentDidUpdate() {
this._highlight();
}
_highlight() {
Prism.highlightElement(this.refs.code);
}
render() {
const className = (this.props.language ? `language-${this.props.language}` : '');
return (
<code></code>