The child component passes parameters to the parent component (without redux)?

like RadioGroup and Radio in antd

<RadioGroup onChange={this.onChange} value={this.state.value}>
   <Radio value={1}>A</Radio>
   <Radio value={2}>B</Radio>
   <Radio value={3}>C</Radio>
   <Radio value={4}>D</Radio>
</RadioGroup>

how do you trigger onChange when you click on Radio?

Aug.14,2021

look at the source code and you can see that Context is passed

.

Group:

static childContextTypes = {
    radioGroup: PropTypes.any,
};

getChildContext() {
    return {
      radioGroup: {
        onChange: this.onRadioChange,//this.props.onChange
      },
    };
  }

Radio:

static contextTypes = {
    radioGroup: PropTypes.any,
};
render(){
    //onChange
    radioProps.onChange = this.context.radioGroup.onChange;
}

take a look at the source code of antd, and set context, in Radio.Group

  python tutorial  

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