How to use the react-window.FixedSizeList function in react-window

To help you get started, we’ve selected a few react-window examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esnet / react-dynamic-forms / packages / react-dynamic-forms / lib / components / AsyncChooser.js View on Github external
//console.log('Inside MenuList:');

            var _props = this.props,
                options = _props.options,
                children = _props.children,
                maxHeight = _props.maxHeight,
                getValue = _props.getValue;

            var _getValue = getValue(),
                _getValue2 = _slicedToArray(_getValue, 1),
                value = _getValue2[0];

            var initialOffset = options.indexOf(value) * height;

            return _react2.default.createElement(
                _reactWindow.FixedSizeList,
                {
                    height: maxHeight,
                    itemCount: children.length,
                    itemSize: 50,
                    initialScrollOffset: initialOffset },
                function (_ref) {
                    var index = _ref.index,
                        style = _ref.style;
                    return _react2.default.createElement(
                        "div",
                        { style: style },
                        children[index]
                    );
                }
            );
        }

react-window

React components for efficiently rendering large, scrollable lists and tabular data

MIT
Latest version published 6 months ago

Package Health Score

80 / 100
Full package analysis