componentWillReceiveProps not firing

前端 未结 4 2162
醉梦人生
醉梦人生 2021-02-18 12:51

In my other classes, componentWillReceiveProps was working nicely, but for some reason, it isn\'t firing here.

ItemView.jsx

class ItemView extends React.         


        
4条回答
  •  既然无缘
    2021-02-18 13:45

    In my case my component was being re-created every render, so I had to put my logic in the constructor. I know its not ideal but it was a simple component and was easier for me to do than try to fix the issue that was causing the component to get re-created each time.

提交回复
热议问题