/** * Created by zack on 2018/4/30. */ import { View, Text, StyleSheet, Image, TouchableOpacity, TextInput } from 'react-native' import React, {Component} from 'react' import {NavigationBarHeight, TabBarHeight, ScreenDimensions} from '../../../../utils/DimensionsTools' export default class MyAnswerBlankItem extends Component { constructor(props) { super(props) this.state = { tips: props.tips } } componentWillReceiveProps(props) { this.setState({ tips: props.tips }) } shouldComponentUpdate(nextProps) { if (nextProps.tips !== this.state.tips) { return true } return false } render() { return( {this.state.tips} ) } } const styles = StyleSheet.create({ View: { width: ScreenDimensions.width, backgroundColor: '#efeff4', alignItems: 'center' }, Text: { marginTop: 114, fontSize: 15, color: '#9c9c9c' } })