Open paulwongx opened 1 year ago
I'm curious about this as well. Hopefully this will be assigned soon.
+1
this solved the issue for me.
useEffect(() => {
console.log("re-compute styles");
varRef.current?.resetAfterIndex(0);
}, [finalList]);
@xerosanyam thank you
useEffect(() => { !!dataSource?.length && instanceRef?.current?.resetAfterIndex?.(0); }, [dataSource]);
@xerosanyam Thanks, it seems like this can actually trigger an update. Any idea why forceUpdate()
does not fix it? I assumed forceUpdate()
would do the trick, but it does not.
+1
I'm rendering a sidebar that can be filtered down every time someone types into the searchbar. A simplified version of my code is below. Everything works except for the fact that there are gaps when filtering. Keep in mind, each section is a conventional "Row" and not a link. Essentially, say the first section gets filtered out, the Row components renders the new first Row properly, but the OLD height is being used for that new first row.
How can I update the
itemSize
once the list changes?From reading other issues, I think this prop might help
resetAfterIndex
but how are you supposed to use it?resetAfterIndex={0}
doesn't work and neither doesresetAfterIndex={{index:0}}
. It says no overload matches this call. But the typescript definitions are there. I think this is only there in class components or something... cuz it looks like the typedefs are for classes...?