New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Items is [] when the component refreshes #146
Comments
@phaistonian Thank you, I will investigate it soon. |
@phaistonian Can you give me a minimal reproduced code snippet or CodeSandbox for this issue? I will check it tomorrow, pretty late in Taiwan, I'm going to sleep. |
it's 11pm down here as well (Greece). Will see to it tomorrow. Thank you. |
Here's a video that will probably indicate the issue. It seems this is state-related. CleanShot.2021-06-17.at.23.44.05.mp4 |
@phaistonian I tried to reproduce your case but I can't make it. Did I miss something? Here's the CodeSandbox. 2021-06-18.2.02.31.mov |
Indeed, it does work in this - super similar scenario. I am not sure what the issue is, to be honest. If you want we can have a zoom call (or have a quick chat) to illustrate the issue — I am afraid I can't share the repo publicly. |
@phaistonian Would you mind to simulate your scenario with a CodeSandbox for me? I will check it later. |
@phaistonian Can you check the |
That's not the issue :( CleanShot.2021-06-18.at.09.30.31.mp4 |
@phaistonian Got it, I think we need a reproduced environment for debugging, plz take your time to prepare it for me. I will think about this case at the same time. |
I can give you access to my system (with AnyDesk or something) to take a look. That would speed things up. Wanna go that way? |
@phaistonian Yes you can invite me, but I will check it later. I think I know your case just not quite sure. If you put the item length as a state or wrap this hook with render items into a component, I think your issue might be solved. |
I sense this will solve this too — but this a hack. |
@phaistonian How about put the items length as a state? |
Tried it. That's not it either. |
@phaistonian Plz invite me, I will take time to investigate it. |
Let's try whereby https://whereby.com/thebestco |
@phaistonian Plz gives me permission to check and run the code (sorry busying now). It will be helpful. I will check it later. Here's my email: hivoid19@gmail.com |
How to access the code? It like a video chat mate. Do you think we should have a reproduced CodeSandbox here? It can help others as well. |
@wellyshen Will try to make some time to do it later. |
@phaistonian Okay, I will check once you provide it. |
@phaistonian Yes, this hook use |
Yes - I did confirm it. If the itemCount remains the same, it's as if it's treated as zero. Will try and bundle your code to a js file to see where exactly the issue is (bundle from .ts to js). |
@phaistonian I need your minimal reproduced code, if you can provide it via CodeSandbox, it will be super helpful. |
@phaistonian We can't pass the refs to the dependencies they will always trigger the effect function. Because they are |
I really can't get it on Codesandbox - it's part of our work repo. Plus decoupling it will take tons of time :( I might be able to try it on the weekend, can't promise it tho. |
@phaistonian Okay, no problem. All I need is the reproduce circumstance, not your business code lol. Take your time mate. |
@phaistonian You can try the latest version of this package to see if this issue still exists or not. If it still exists, leave a reproduce code via CodeSandbox, I will fix it soon. |
@wellyshen will do :-) Thanks |
Hi, thank you for the great library. was the issue with itemCount fixed ? thank you |
@crow7m Have you encountered the issue? |
Close due to inactive, plz use the latest version to see whether this issue still occurs or not. |
Hai @wellyshen first things first I want to thankfull for the library. I Had similiar issue with this. After successfull render the components, I move to other pages and back to the components, data wont to render it's because So I used to
pass This also avoid the callback from being invoked repeatedly. This is my full code:
Hope it's help, thank you. |
It seems that when you mount/unmount the component and the
itemCount
does not change theitems
is [] (after the first time).A hacky way out of it is to do something like
itemCount: myCount + Math.round(Math.random() * 100)
and filter later.In other words, some kind of check takes place based on the
itemCount
that causes cache-related (I presume) issues.The text was updated successfully, but these errors were encountered: