【问题标题】:Trigger Radio buttons Onclick function without using REF在不使用 REF 的情况下触发单选按钮 Onclick 功能
【发布时间】:2020-11-26 07:56:11
【问题描述】:

在 React 中,当值 potentialMatch.isExactMatch 为 True 时,应自动触发单选按钮 onClick 函数。不使用 ref 作为输入类型。

 <input type="radio"  onClick={() => {this.selectedInvitingOrg(param)}}
  name="potentialMatchRadioGroup" checked={potentialMatch.isExactMatch}/>

【问题讨论】:

标签: javascript reactjs


【解决方案1】:

请看一下,如何管理它

代码沙盒:https://codesandbox.io/s/determined-liskov-vjo92?file=/src/App.js

【讨论】:

  • 如果您喜欢我的回答或者您从我的回答中得到任何帮助,请不要忘记考虑投票并通过单击右箭头将此答案作为您的最佳答案,谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-11-27
  • 2022-12-12
  • 2018-10-21
  • 1970-01-01
  • 2021-07-12
  • 2012-08-02
相关资源
最近更新 更多