A simple dialog box has a display / close status
I think the following situations can be done
1. The parent component controls the (props) when the child component informs the parent component to change the props when the btn is clicked.
2 the child component controls the child component to display / close the parent component through its own state. You need to call the child component to achieve the display and close of the child component
I am more inclined to method 2 because I think it is relatively simple (the state is controlled by sub-components have a systematic feeling), but some bosses say that method 1 is more data-driven and pure, which is better and more in line with the idea of componentization?