ComponentWillReceiveProps executed twice. Why?

background:
purpose brief: click the button, adjust this.props.history.push () to cause the change of location, and judge in componentWillReceiveProps that if prev.location and next.location, are not equal, the mask layer is displayed.
question
first declare that the current component does not have child components. Printing a random console.log (XXX), in componentWillReceiveProps is executed (printed) twice. Why?

Mar.20,2021

see if there is any place to modify the props of the component


clipboard.png
cwr
clipboard.png
render

render
clipboard.png
then it's not hard to find that there are two ways. One is initialized, and the other is render, the parent component of the parent component.

then why the parent component of the parent component render twice, then look at the parent component of the parent component.

if you have any questions about this answer, please take it. Thank you

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bfa512-3196a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bfa512-3196a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?