TurkNet / design-system

Design System with Storybook
MIT License
16 stars 2 forks source link

Error: Cannot Assign Refs to Function Components in React - Requires forwardRef Implementation #385

Open halilbarim opened 2 weeks ago

halilbarim commented 2 weeks ago

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

I encountered an issue where attempting to assign ref to a function component throws a warning: "Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?".

When I remove the ref parameters from the controller fields, the issue resolves, and the code works as expected. However, we need to properly handle ref in the Select component by implementing or wrapping it with React.forwardRef() to avoid this warning and ensure proper functionality.

Any insights on integrating ref with function components in this scenario would be helpful!

create-issue-branch[bot] commented 2 weeks ago

Branch 385-error-cannot-assign-refs-to-function-components-in-react---requires-forwardref-implementation created!