ios - react native render only part -
i have feed , bottom menu can filter feed. when filter activated feed reloads data api. root render causing menu collapse every time. how can make feed reloads?
var main = react.createclass({ getinitialstate: function() { return { reloadfeeddata: false, }; }, reloadfeeddata: function(){ console.log('setting root state') this.setstate({reloadfeeddata:true}); }, renderscene: function(route, nav) { var reload = this.state.reloadfeeddata switch (route.name) { case 'feed': return ( <feed navigator={nav} reloadfeeddata={reload} /> ); default: return ( <feed navigator={nav} reloadfeeddata={reload} /> ); } }, render: function() { console.log('root render'); return ( <view style={styles.container}> <navigator style={styles.navigator} renderscene={this.renderscene} initialroute={{ component: feed, }} /> <bottommenu reloadfeeddata={this.reloadfeeddata} /> </view> ); } });
to answer own question, issue bad componentwillreceiveprops triggered on things shouldnt.