Hey! Trying to make react-virtualized-auto-sizer w...
# react
p
Hey! Trying to make react-virtualized-auto-sizer work and it needs function as children to render.
Copy code
<AutoSizer>
    {({height, width}) => (
      <List
        height={height}
        rowCount={list.length}
        rowHeight={20}
        rowRenderer={rowRenderer}
        width={width}
      />
    )}
  </AutoSizer>
Actually the same pattern is used with libs for list virtualisation. I found this thread, but the solution is still not clear. Did anyone make it work? https://kotlinlang.slack.com/archives/C5ZTZ6ER0/p1628078963002700
@turansky thanks for the quick reply! Tried it, but got this error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports.
just in case, multiplatform version 1.8.21, wrappers version 1.0.0-pre.544
t
You need declare
@JsModule
, where
AutoSize
located
p
Thanks @turansky! Sorry about that, I had JsModule, but turned out that AutoSizer was not declared in a usual way and it wasn’t imported because of that. Now that I fixed it it works just fine.