mirror of
https://github.com/desktop/desktop
synced 2024-10-28 19:20:01 +00:00
Merge pull request #719 from desktop/you-look-like-a-ref-face
Button reference fix
This commit is contained in:
commit
885c401481
2 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ interface IButtonProps {
|
|||
* handling of the `ref` type into some ungodly monstrosity. Hopefully someday
|
||||
* this will be unnecessary.
|
||||
*/
|
||||
readonly reference?: React.Ref<HTMLButtonElement>
|
||||
readonly onButtonRef?: (instance: HTMLButtonElement) => void
|
||||
}
|
||||
|
||||
/** A button component. */
|
||||
|
@ -38,7 +38,7 @@ export class Button extends React.Component<IButtonProps, void> {
|
|||
disabled={this.props.disabled}
|
||||
onClick={this.onClick}
|
||||
type={this.props.type}
|
||||
ref={this.props.reference}>
|
||||
ref={this.props.onButtonRef}>
|
||||
{this.props.children}
|
||||
</button>
|
||||
)
|
||||
|
|
|
@ -78,7 +78,7 @@ export class ToolbarButton extends React.Component<IToolbarButtonProps, void> {
|
|||
return (
|
||||
<div className={className}>
|
||||
{preContent}
|
||||
<Button onClick={this.onClick} reference={this.onButtonRef}>
|
||||
<Button onClick={this.onClick} onButtonRef={this.onButtonRef}>
|
||||
{icon}
|
||||
{this.renderText()}
|
||||
{this.props.children}
|
||||
|
|
Loading…
Reference in a new issue