score:0

i fixed this with a mixture of componentdidmount and componentwillreceiveprops to figure out if the new route is hit and the redux selectbook is set or not. seems to be working now without constant refresh.

score:1

most likely it is because you are binding it in render. this will create not only multiple instances of function objects in runtime, every time render is called for outer function. if button is a pure component which it should most likely be, every time the button is re-rendered it will create a new function object reference for onclick and since buttons prop is changing because it's reference is it will re-render

  onclick={this.handledelete.bind(this, item)} //bad practice

do below instead, this will make sure all the onclick refer to one function object reference which is bound in constructor and hence making your component more performant.

constructor(){
this.handledelete= this.handledelete.bind(this)
}

//bind it once use every where 
onclick={this.handledelete}

and remove binds in onclicks.


Related Query

More Query from same tag