Skip to content

createButton isn't passing user props to the element #69

@thetarnav

Description

@thetarnav

User props such as class or children aren't being passed down to returned buttonProps.
The button doesn't seem clickable with Enter too..

export const Button: ParentComponent<
  JSX.IntrinsicElements['button'] & AriaButtonProps
> = props => {
  let ref!: HTMLButtonElement
  const { buttonProps } = createButton(props, () => ref)

  return <button {...buttonProps} ref={ref} />
};

// class and children aren't being applied
<Button class="btn">Hello</Button>

repro: https://stackblitz.com/edit/createbutton-props-issue?file=index.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions