鉴于以下设置:
import { AppRegistry } from "react-native";
import { Provider } from "mobx-react";
import Application from "./src/components/Application";
import ApplicationStore from "./src/stores/ApplicationStore";
import { name as appName } from "./app.json";
let app = ApplicationStore.create();
AppRegistry.registerComponent(name, () => (
<Provider app={app}>
<Application />
</Provider>
));
ApplicationStore 未定义,因此无法创建...
Cannot read property 'create' of undefined
Module AppRegistry is not a registered callable module (calling runApplication)
有没有更好的方法来设置 ApplicationStore,并通过注入使其可用于组件?
const Application = inject("app")(
observer(
class Application extends Component {
...
这就是我在反应应用程序()中所做的事情,尽管是通过ReactDOM.render()......
一如既往,所有方向都受到赞赏,所以提前感谢!