Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Do you pass the MobX stores down to every child component as props or do you use @inject? I started with the former but all of a sudden all my components had all these "default" props that cluttered things up. @inject seems great but the documentation doesn't push it enough to make me believe it's best practice.


Neither. Just import a singleton root store and reference it directly.


I was using global stores but recently moved to @inject. I needed a way to reset my stores on logout. Hence now i create a root store and initialize rest of the stores.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: