How to call super? after constructor statements

first of all, there is a baseClass

class BaseDialog extends React.Component {
  constructor(props) {
    this.state[this.state.preProp] = "ValueA"; // this.state["KeyA"] = "ValueA"
  }
}

class InstanceDialog extends BaseDialog {
  constructor(props){
    super(props)
    this.state.preProp = "KeyA";
  }
}

because BaseDialog is parent, you can"t get preProp,. Is there any way for BaseDialog to get the preProp value in instance

?
May.05,2021

in design pattern, this is a reverse dependency, which violates the design principle, and the parent component should not rely on the state of the child component. If you really need a child component to pass a value to the parent component, you can pass


no way (impossible)

in props.
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-1bf1c47-31db9.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-1bf1c47-31db9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?