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

receive unexpected response when click react-virtualized list item #1723

Closed yaotusa closed 1 month ago

yaotusa commented 2 years ago

i beg your pardon

1、i wrote a simple demo to demostrate this problem

https://codesandbox.io/s/wizardly-nightingale-449cko

2、the operation steps for produce the problem

console doesn't output as expected: render ts: 1646305500814 onclick ts: 0

render process has already done, but the function onClick in "App.js" still get the old value. why it happen?

3、as a comparison, i do another test

console output as expected: render ts: 1646305752895 onclick ts: 1646305752895

4、further more, in the line 26th of the code file "VirtualList.js", i modify the value of the props rowRenderer from "this.cellRenderer" to "renderItem",

console also output as expected: render ts: 1646306154833 onclick ts: 1646306154833

In theory, the effect of the function "this.cellRenderer" and "renderItem" should be the same;

========================================

above all;

appreciated your answers

please help me; thank you very much;