ReactのrenderからPromiseを呼び出すと必ずobjectが返ってきてしまいます。
なぜでしょうか?
ご存じの方がおられましたら教えて下さい。
import React, {Component} from 'react'; import {Promise} from 'es6-promise'; export default class KurasuA extends Component { constructor (props) { super (props); this.yobidasiFunc = this.yobidasiFunc.bind (this); }; damiFunc () { ・・・ }; yobidasiFunc () { return new Promise ( (resolve, reject) => { ・・・ let htmlTag = <a>・・・</a>; resolve (htmlTag); }).then ((result) => { return result; }); }; render () { return ( <div> { false ? this.damiFunc() : this.yobidasiFunc()} </div> ); }; }
同じように悩んでいる方がいるようです。
renderで呼び出したら期待値と異なりobjectが返ってきた
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/10 11:13