Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { Component } from 'react';
import { FixedSizeList, shouldComponentUpdate } from 'react-window';
import CodeBlock from '../../components/CodeBlock';
import ProfiledExample from '../../components/ProfiledExample';
import CODE_HORIZONTAL from '../../code/FixedSizeListHorizontal.js';
import CODE_VERTICAL from '../../code/FixedSizeListVertical.js';
import styles from './shared.module.css';
class Item extends Component {
// Ignore changes in style wrapper Object.
shouldComponentUpdate = shouldComponentUpdate.bind(this);
render() {
const { data, index, style } = this.props;
return (
<div style="{style}">
{data} {index}
</div>
);
}
}
export default function() {
);
}
}
class PageRow extends Component {
static propTypes = {
index: number,
style: shape(),
data: shape({
scale: number,
searchText: string,
customTextRenderer: func
})
};
shouldComponentUpdate = shouldComponentUpdate.bind(this);
render() {
const { index, style, data } = this.props;
const { scale, customTextRenderer, searchText } = data;
const key = customTextRenderer
? `custom_${searchText}`
: `default_${index}`;
return (
<div style="{style}">
</div>