bvaughn / react-window

React components for efficiently rendering large lists and tabular data
https://react-window.now.sh/
MIT License
15.72k stars 782 forks source link

React-window not compatible with preact-island #657

Closed eldzis closed 3 weeks ago

eldzis commented 2 years ago

If using preact-island library to create widgets with preact, react-window component is not rendering. Everything works in default preact but not in preact-island. What could be the possible solutions for this problem?

react-window usage:

import { FixedSizeList as List } from 'react-window';

const Row = ({ index, style }) => (
  <div style={style}>Row {index}</div>
);

const Example = () => (
  <List
    height={150}
    itemCount={1000}
    itemSize={35}
    width={300}
  >
    {Row}
  </List>
);

export default Example;

Preact-island rendering:

import { h } from "preact";
import { createIsland } from "preact-island";
import Widget from "./component";

const island = createIsland(Widget);
island.render({
    selector: "body",
});