Closed evelant closed 4 years ago
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 notifications@github.com 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 https://github.com/mobxjs/mobx-react/issues/856, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4NBHADQGZBTOJZ6JFIR3RPA4LHANCNFSM4MTZCFAQ .
Ah, I made an unrelated mistake causing confusion. trace()
works fine. Thanks!
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 triedtrace()
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?