Fork me on GitHub
#re-frame
<
2023-09-15
>
Marius08:09:27

Hi all, I am stuck with a bug in an “input field” component of my app. When I pass a “disabled?” parameter (deref of an atom), the component seems to be rerendered (keeps subscribing) every second — although I am not sure about that, I only see the recurring subscription, print statements were not executed. Really weird (for me). Unfortunately the source code is to big to post it here, but perhaps someone is willing to jump on a screen sharing session some time within the next 5-6 hours?

p-himik08:09:16

If you're using the latest React, you can use React DevTools to see what made a particular component re-render. You can also use re-frame-10x to trace any values that are changing that might lead to a re-render.

Marius08:09:41

I have re-frame-10x and see the subscription counter in “stats” counting up every second, but there are no eventse

Marius08:09:26

I’ll check the React DevTools, thanks!

p-himik09:09:17

Do you have all these traces enabled in re-frame-10x?

p-himik09:09:42

Also, "every second" makes it sound like you call js/setTimeout or a similar function somewhere - maybe just searching for those in the sources will reveal the cause.

Marius10:09:45

it keeps counting up, but I do not see anything else than :sub/run,

Nasiru Ibrahim08:09:22

Show us a screenshot of the sub code, and the button implementation. With this we can help you look to it

Abhinav02:09:51

@U02G3DBJ2SY I know this isn't directly related to your issue but I wrote something about UI dev and its mostly to do with input fields, and re-rendering issues. Maybe it might help you. https://abhinavomprakash.com/posts/what-makes-frontend-development-tricky/