次のコンポーネントには、コンストラクターで値 5 に初期化される状態プロパティがあります。ただし、レンダリング内で使用すると、未定義が返されます。理由がわかりません。
constructor() {
super();
this.state = {
loadcomplete: false,
twitterfeed: {
techcrunch: [],
laughingsquid: [],
appdirect: []
},
tweetCount: 30
};
}
render() {
let { tweetCount } = this.state.tweetCount;
console.log(tweetCount, "tweetcount");
return(<div></div>)
}