File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ That's it, you're ready to go!
6060Show a toast forever until you manually close it:
6161``` javascript
6262 this .refs .toast .show (' hello world!' , DURATION .FOREVER );
63+ ```
64+
65+ Or pass an element:
66+ ``` javascript
67+ this .refs .toast .show (< View>< Text > hello world! < / Text >< / View> );
68+ ```
6369
6470 // later on:
6571 this.refs.toast.close('hello world!');
Original file line number Diff line number Diff line change 6464
6565在需要弹出提示框时使用上面代码即可。
6666
67+ 或者像这样
68+ ``` javascript
69+ this .refs .toast .show (< View>< Text > hello world! < / Text >< / View> );
70+ ```
6771
6872
6973### 用例
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export default class Toast extends Component {
108108 < Animated . View
109109 style = { [ styles . content , { opacity : this . state . opacityValue } , this . props . style ] }
110110 >
111- < Text style = { this . props . textStyle } > { this . state . text } </ Text >
111+ { React . isValidElement ( this . state . text ) ? this . state . text : < Text style = { this . props . textStyle } > { this . state . text } </ Text > }
112112 </ Animated . View >
113113 </ View > : null ;
114114 return view ;
You can’t perform that action at this time.
0 commit comments