bvaughn / react-virtualized

React components for efficiently rendering large lists and tabular data
http://bvaughn.github.io/react-virtualized/
MIT License
26.31k stars 3.05k forks source link

Multigrid error #1067

Open hyeminHwang opened 6 years ago

hyeminHwang commented 6 years ago

Hi, I'm new in react-virtualized. I'm trying to test Multigrid example in sandbox, there is an error. (Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.) By the way, I'm trying to use react-virtualized 7.17.1 version.

wuweiweiwu commented 6 years ago

Hi @hyeminHwang can you post a codesandbox with the mentioned error? :)

hyeminHwang commented 6 years ago

https://codesandbox.io/s/62yoxnmx1w

Here it is. Is it version prob?

pete-moss commented 6 years ago

My best guess here is that your list definition is a sparse Array. Note that your 2nd outer element only has 1 item ["hyemin"], but your first element ["Brian Vaughn", ...] has 5. Note that you are telling the MultiGrid that you have 2 rows and 5 columns. My guess is that your cellRenderer is then being asked to render cell (1, 1), (1, 2), ... and you are returning undefined for these (because of the sparse Array). Try returning null or an empty string for these cells that are undefined and see if it gets any better.

wuweiweiwu commented 6 years ago

Hm I dont think version is the problem. However, I am unable to run your sandbox. It is a blank screen for me