File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ class ToastContainer extends Component {
6464 static propTypes = {
6565 ...ViewPropTypes ,
6666 containerStyle : ViewPropTypes . style ,
67+ message : PropTypes . string ,
68+ component : PropTypes . element ,
6769 duration : PropTypes . number ,
6870 visible : PropTypes . bool ,
6971 position : PropTypes . number ,
@@ -236,24 +238,26 @@ class ToastContainer extends Component {
236238 style = { [
237239 styles . containerStyle ,
238240 { marginHorizontal : windowWidth * ( ( 1 - TOAST_MAX_WIDTH ) / 2 ) } ,
239- props . containerStyle ,
240241 props . backgroundColor && { backgroundColor : props . backgroundColor } ,
241- {
242- opacity : this . state . opacity
243- } ,
242+ props . containerStyle ,
243+ { opacity : this . state . opacity } ,
244244 props . shadow && styles . shadowStyle ,
245245 props . shadowColor && { shadowColor : props . shadowColor }
246246 ] }
247247 pointerEvents = "none"
248248 ref = { ele => this . _root = ele }
249249 >
250- < Text style = { [
251- styles . textStyle ,
252- props . textStyle ,
253- props . textColor && { color : props . textColor }
254- ] } >
255- { this . props . children }
256- </ Text >
250+ { this . props . component ? (
251+ this . props . component
252+ ) : (
253+ < Text style = { [
254+ styles . textStyle ,
255+ props . textStyle ,
256+ props . textColor && { color : props . textColor }
257+ ] } >
258+ { this . props . message }
259+ </ Text >
260+ ) }
257261 </ Animated . View >
258262 </ TouchableWithoutFeedback >
259263 </ View > : null ;
You can’t perform that action at this time.
0 commit comments