Mobx

Debugging

trace()

trace() helps show what it was that made MobX update. this is helpful for tracking down unexpected renders or infinite loops.

import {trace} from 'mobx-react'
{...}
render() {
trace();
return ();
}

toJS()

Each observable has a method of toJS() on it. May need to look into typing them correctly.


Discuss this article on Twitter

Category:

state-management

Tags:

debugstate
Helpers

© 2012-2022, built with Next.js and Chakra UI

Instagramtwittergithubjoelmturner's DEV Profilejoelmturner's Mastodon Profile