Skip to content

Error received when setting Button 'as' to a SFC #2779

@ryanflowers

Description

@ryanflowers

Bug Report

The Button component assumes that the 'as' provided accepts the ref property. Stateless functional components do not support this.

Steps

In sandbox below just load it fresh with the console open to see the error which happens on first load only.

Expected Result

To error when using SFC

Actual Result

Warning: Stateless function components cannot be given refs. Attempts to access this ref will fail.

Check the render method of Button.
in as (created by Button)
in Button (created by TestButton)
in TestButton

Version

0.77.1

Testcase

https://codesandbox.io/s/400zm5vkr7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions