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

fix: React.forwardRef() error in rainbow-button.tsx #513

Closed
wants to merge 2 commits into from

Conversation

kulterryan
Copy link
Contributor

@kulterryan kulterryan commented Jan 15, 2025

Issue

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

Solution

  • Add React.forwardRef and pass the ref to the button element.

Changes:

  • Modify the RainbowButton component to use React.forwardRef.
  • Accept the ref parameter and pass it to the element.

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

**Solution: **
- Add React.forwardRef and pass the ref to the button element.

**Changes: **
- Modify the RainbowButton component to use React.forwardRef.
- Accept the ref parameter and pass it to the <button> element.
Copy link

vercel bot commented Jan 15, 2025

@kulterryan is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@kulterryan kulterryan changed the title Update rainbow-button.tsx Fixed React.forwardRef() error in rainbow-button.tsx Jan 15, 2025
@kulterryan kulterryan changed the title Fixed React.forwardRef() error in rainbow-button.tsx fix: React.forwardRef() error in rainbow-button.tsx Jan 15, 2025
@kulterryan kulterryan marked this pull request as draft January 15, 2025 05:18
@kulterryan kulterryan marked this pull request as ready for review January 15, 2025 05:22
@itsarghyadas
Copy link
Collaborator

Hey @kulterryan thanks for catching this! We’re already aware of this situation and are working on improving all the buttons, including the rainbow button.

Closing this PR in favor of #492

Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants