How to inject mobx store into a stateless component How to inject mobx store into a stateless component reactjs reactjs

How to inject mobx store into a stateless component


inject returns a function that you can use on a observer functional component:

var Example = inject("myStore")(observer((props) => {  // ...}));


A variant of @Tholle answer :

const Example = inject("myStore")(observer(({myStore, otherProp}) => {  // ...}));