This repository has been archived by the owner on Mar 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Components with forwardRef fail when trying to get displayName #91
Comments
Mind submitting a pull request with a test and demo and a fix, please?
…Sent from my iPhone
On May 22, 2019, at 14:16, Dennis Thompson ***@***.***> wrote:
Repro the issue using the following component:
import React from 'react';
export default function Button({ children, ...rest }) {
return <button {...rest}>{children}</button>;
}
Button.displayName = "Button";
The correct way to get the display name is not through JSX magic, but rather from the static member on the object. With function components jsx.type.prototype is undefined.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Already working on it :) |
Turns out this is happening |
atomicpages
pushed a commit
to atomicpages/cypress-react-unit-test
that referenced
this issue
May 22, 2019
* Adding tests for React.memo * Adding tests for React.forwardRef * Adding basic hook tests
bahmutov
pushed a commit
that referenced
this issue
Jun 5, 2019
* Fixing #91 * Adding tests for React.memo * Adding tests for React.forwardRef * Adding basic hook tests * Fixing some issues * Fixing bad .type property in get where the selector is a function * Ensuring all specs pass * Adding stub for hooks spec for the time being...
dmtrKovalenko
pushed a commit
to cypress-io/cypress
that referenced
this issue
Oct 1, 2020
…-test#92) * Fixing cypress-io/cypress-react-unit-test#91 * Adding tests for React.memo * Adding tests for React.forwardRef * Adding basic hook tests * Fixing some issues * Fixing bad .type property in get where the selector is a function * Ensuring all specs pass * Adding stub for hooks spec for the time being...
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Repro the issue using the following component:
The correct way to get the display name is not through JSX magic, but rather from the static member on the object. With function components
jsx.type.prototype
is undefined.The text was updated successfully, but these errors were encountered: