react-native+MobX
发布时间:2020-12-15 20:36:50 所属栏目:百科 来源:网络整理
导读:参考https://segmentfault.com/a/1190000014165693同事解决其发生的问题 1.版本 "mobx": "4.3.1", "mobx-react": "5.1.0", 否则会报错 2.安装 yarn add babel-plugin-transform-decorators-legacy yarn add babel-preset-react-native-stage-0 yarn add babe
参考https://segmentfault.com/a/1190000014165693同事解决其发生的问题 "mobx": "4.3.1", yarn add babel-plugin-transform-decorators-legacy yarn add babel-preset-react-native-stage-0 yarn add babel-plugin-transform-runtime
import { homeStore } from "./home";
import React,{Component} from ‘react‘; import {observer,inject} from ‘mobx-react‘; <Text>状态管理器</Text><Text>{this.props.homeStore.name}</Text><Text>{this.props.homeStore.msg}</Text> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |