Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputText component reference returns Invalid prop forwardRef #1818

Closed
vebersol opened this issue Feb 16, 2021 · 0 comments
Closed

InputText component reference returns Invalid prop forwardRef #1818

vebersol opened this issue Feb 16, 2021 · 0 comments
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@vebersol
Copy link

I'm submitting a ...

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Codesandbox Case (Bug Reports)
https://codesandbox.io/s/primereact-test-forked-hszlq

Current behavior
I've upgraded from version 5.0.2 to primereact 6.0.2 and a reference I've set in an inputtext component is no longer working, as you can see in codesandbox. It fires the error below in console:

Warning: Failed prop type: Invalid prop `forwardRef` of type `object` supplied to `InputTextComponent`, expected `function`.    in InputTextComponent (created by ForwardRef)

    in ForwardRef (created by App)

    in App

Expected behavior
I was expecting this reference to work in order to be able to focus an input after setstate was fired. It was properly working before the upgrade, now the reference is missing and this error breakes all my Jest tests.

Minimal reproduction of the problem with instructions
Defining a reference using something like referenceVariable = createRef() and adding a property ref={referenceVariable} will fire up this error in primereact 6.0.2. I've tried it among different node versions, like 10, 14 and 15.

Please tell us about your environment:
I'm running MacOS BigSur, with Yarn, Webpack and ruby on rails and Puma webserver. But this error was easily reproduced in codesandbox.

  • React version:
    16.14.0

  • PrimeReact version:
    6.0.2

  • Browser: Chrome

  • Language: ES6/7

@mertsincan mertsincan self-assigned this Feb 17, 2021
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Feb 17, 2021
@mertsincan mertsincan added this to the 6.1.0 milestone Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants