Log why function component re-rendered
evelant opened this issue · comments
Andrew M commented
Perhaps I'm missing something obvious here, but I can't seem to find a way to log the reason why a function component wrapped in observer
is re-rendering. I tried trace()
but it just prints "[mobx.trace] 'observer' tracing enabled" and no further information.
What's the best way to log why a function component is rendering?
Michel Weststrate commented
put the trace at the end of your func. Note that it might also rerender
unrelated to mobx, for that you can use the React profiler
…On Wed, Apr 29, 2020 at 3:44 PM amorsillo ***@***.***> wrote:
Perhaps I'm missing something obvious here, but I can't seem to find a way
to log the reason why a function component wrapped in observer is
re-rendering. I tried trace() but it simple prints "[mobx.trace]
'observer' tracing enabled" and no further information.
What's the best way to log why a function component is rendering?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#856>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBHADQGZBTOJZ6JFIR3RPA4LHANCNFSM4MTZCFAQ>
.
Andrew M commented
Ah, I made an unrelated mistake causing confusion. trace()
works fine. Thanks!