我正在尝试将一个值传递给基于react-native的应用程序的下一页。它正在我的应用程序的其他页面上工作。但它不适用于其中一个视图控制器。这是代码。
class AddProductController extends Component {
constructor(props) {
super(props);
this.state = {
avatarSource: [],
totalImages: [],
alreadySelect: false,
currentUser: global.currentUser,
position: 1,
isLoading: false,
};
}
next(){
var advs = new Advs()
advs.setImages(this.state.totalImages)
console.log('days3',advs)
Actions.addDescriptionController({advertisement:advs})
}
}
export default AddProductController;
import React, { Component } from 'react';
import { Image, Dimarketnsions, ScrollView, TouchableWithoutFeedback, TouchableOpacity, TextInput, FlatList, } from 'react-native';
import { Actions, ActionConst } from 'react-native-router-flux';
import {
View, Container, Header, Title, Content, Text, Button, Icon, Left, Body, Right, Footer, InputGroup, Input, List, ListItem,
} from 'native-base';
import { Col, Row, Grid } from 'react-native-easy-grid';
import FooterSection, { IndexEnum } from '../../components/Footer';
import styles from './styles';
import SearchHeaderWrapper from '../../components/SearchHeaderWrapper';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
class AddDescriptionController extends Component {
constructor(props) {
super(props);
this.state = {
text: '',
advertisement : ''
};
}
componentWillMount() {
}
componentWillReceiveProps(nextProps) {
console.log("pass")
}