componentWillReceiveProps not firing

前端 未结 4 2184
醉梦人生
醉梦人生 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条回答
  •  猫巷女王i
    2021-02-18 13:35

    After much painful debugging, I found out that the problem was that ItemView was being called inside a modal (react-bootstrap) which for some reason, doesn't support componentWillReceiveProps(). Ended up fixing the issue by refactoring the code. Thanks guys!

提交回复
热议问题