What are the potential issues to implement a @inject
decorator which does not depend to mobx-react
's Provider
component (which stores its properties in react's context)?
The usage of the inject
would be something like this:
// MyComponent.js
import { authManager } from './services';
const MyComponent = ({ authManager }) => ...;
export default inject({ authManager })(MyComponent);
It just merges its parameter with component props.
You can pass a function as the first argument into the inject function. https://github.com/mobxjs/mobx-react#customizing-inject
It will not depend on the context, it will just map the returned object to your props.
I didn't tested it