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

[Hold] Getting console error when opening public room #21634

Closed
1 of 6 tasks
kavimuru opened this issue Jun 26, 2023 · 12 comments
Closed
1 of 6 tasks

[Hold] Getting console error when opening public room #21634

kavimuru opened this issue Jun 26, 2023 · 12 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@kavimuru
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

Action Performed:

  1. Login as any user.
  2. Open any public room (/r/5593084223054221)

Expected Result:

No console error occurs

Actual Result:

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

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.32-5
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

Recording.5178.mp4

Screenshot 2023-06-22 at 1 36 07 AM (1)

Expensify/Expensify Issue URL:
Issue reported by: @allroundexperts
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1687379866272869

View all open jobs on GitHub

@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

Triggered auto assignment to @flaviadefaria (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@cubuspl42
Copy link
Contributor

cubuspl42 commented Jun 26, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

When a user mention (MentionUserRenderer) is displayed, the console error about Function Components is shown.

What is the root cause of that problem?

MentionUserRenderer wraps a TextLink with a Tooltip, while Tooltip passes its child to Hoverable. In turn, Hoverable expects its child to be an instance of a component that accepts the ref special property.

However, TextLink is a simple function component. Function components don't support ref by default.

What changes do you think we should make in order to solve the problem?

A simple, local fix is to forward the reference in TextLink.

const TextLink = forwardRef((props, ref) => {
    const rest = _.omit(props, _.keys(propTypes));
    const additionalStyles = _.isArray(props.style) ? props.style : [props.style];

    // ...

    return (
        <Text
            ref={ref}
            // ...
        >
            {props.children}
        </Text>
    );
});

My branch

What alternative solutions did you explore?

I tried figuring out how Hoverable implementation could be adjusted, so it doesn't require its child to accept ref, but that seems to be trickier than I thought. It's probably beyond the scope of this particular issue.

@gadhiyamanan
Copy link
Contributor

I think this is dupe #21496

@allroundexperts
Copy link
Contributor

I think this is dupe #21496

@gadhiyamanan I think the error is same but its happening at different places.

@gadhiyamanan
Copy link
Contributor

The root cause is same

@melvin-bot melvin-bot bot added the Overdue label Jun 29, 2023
@flaviadefaria
Copy link
Contributor

@gadhiyamanan @allroundexperts will this be resolved by the changes in #21496?

@melvin-bot melvin-bot bot removed the Overdue label Jun 30, 2023
@allroundexperts
Copy link
Contributor

@gadhiyamanan @allroundexperts will this be resolved by the changes in #21496?

I think so, yes. We can keep this on hold if that works.

@melvin-bot melvin-bot bot added the Overdue label Jul 3, 2023
@flaviadefaria
Copy link
Contributor

Ok so I'll put this on hold until #21496 closes and switch it to weekly.

@melvin-bot melvin-bot bot removed the Overdue label Jul 3, 2023
@flaviadefaria flaviadefaria changed the title Getting console error when opening public room [Hold] Getting console error when opening public room Jul 3, 2023
@flaviadefaria flaviadefaria added Weekly KSv2 and removed Daily KSv2 labels Jul 3, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 11, 2023
@flaviadefaria
Copy link
Contributor

Still on hold

@melvin-bot melvin-bot bot removed the Overdue label Jul 26, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 3, 2023
@flaviadefaria
Copy link
Contributor

Alright #21496 has now closed do we want to check if the error is still happening?

@melvin-bot melvin-bot bot removed the Overdue label Aug 9, 2023
@flaviadefaria flaviadefaria added Daily KSv2 and removed Weekly KSv2 labels Aug 9, 2023
@flaviadefaria
Copy link
Contributor

It looks like we're good here so closing this.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

5 participants