import React,{Component} from 'react';
import { View, Text, Image, FlatList,TextInput, TouchableOpacity} from 'react-native';
import {observer,inject } from 'mobx-react'
import {toJS} from 'mobx'
/***
* toJS 處理mobx傳回的資料 toJS(data) = {};
* @inject 注入監聽的資料 這裡為 carStore
* @observer 監聽
*
* created by wangweiruning on 2019-9-25
* 實作簡單的購物車邏輯
* ***/
@inject('carStore')
@observer
export default class My extends Component{
constructor(props){
super(props)
this.cardata = this.props.carStore;
}
separatorView = () => {
return (
<View style={
{ height: 10, backgroundColor: '#e9e9e9' }} />
)
};
renderItem = (item,index) => {
return (
<ShoppingItemComponent
itemData={item}
// carStore={this.props.carStore}
/>