Skip to content

[Due for payment 2026-02-03] [$1000] Fix console errors post React 19 upgrade #67033

Closed

Description

@mountiny

After the React 19 upgrade, there are console errors like this in the App

Image

These are reducing the console's readability and distracting the developer, so let's fix this to improve the developer experience.

Issue OwnerCurrent Issue Owner: @trjExpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 24, 2025
  2. melvin-bot commented on Jul 24, 2025

    @melvin-bot

    Triggered auto assignment to @trjExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. aadil42 commented on Jul 24, 2025

    @aadil42
    Contributor

    Proposal

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

    We're getting the below errors in console after upgrading to react 19.

    Image

    What is the root cause of that problem?

    This is happening because now in react 19 ref can be passed down as any other regular prop and we don't need to wrap the child component which is receiving ref from its parent component with forwardRef.

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

    We should simply avoid wrapping component in forwardRef. Pass ref as regular prop.

    One such example is ActiveHoverable component. I have given an example with ActiveHoverable. similar changes can be applied to other components that are using forwardRef.

    An example with ActiveHoverable.

    We can replace this part of the code with the suggested code.

    function ActiveHoverable({onHoverIn, onHoverOut, shouldHandleScroll, shouldFreezeCapture, children}: ActiveHoverableProps, outerRef: Ref<HTMLElement>) {
    const [isHovered, setIsHovered] = useState(false);
    const elementRef = useRef<HTMLElement | null>(null);

    suggested code:

    function ActiveHoverable({onHoverIn, onHoverOut, shouldHandleScroll, shouldFreezeCapture, children, outerRef}: ActiveHoverableProps) {

    We should add correct type here in the type definition:

    type HoverableProps = {
    /** Children to wrap with Hoverable. */
    children: HoverableChildren;

    add this type:

        outerRef: Ref<HTMLElement>;

    We should pass correct prop here:

    <ActiveHoverable
    // eslint-disable-next-line react/jsx-props-no-spreading
    {...props}
    ref={ref}
    />

    <ActiveHoverable
                // eslint-disable-next-line react/jsx-props-no-spreading
                {...props}
                outerRef={ref}
            />

    Avoid using forwardRef here.

    export default forwardRef(ActiveHoverable);

    return without wrapping the comopnent in forwardRef

      export default ActiveHoverable

    Note: I only suggested an example with ActiveHoverable there are other components that are using forwardRef so we need to change them in a similar way.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  4. aadil42 commented on Jul 24, 2025

    @aadil42
    Contributor

    Here's the Documentation for Deprecated element.ref.

    https://react.dev/blog/2024/04/25/react-19-upgrade-guide#deprecated-element-ref

    Image
  5. mountiny commented on Jul 24, 2025

    @mountiny
    ContributorAuthor

    @aadil42 thanks! This issue is not open for proposals, please check out others with Help Wanted label

  6. aadil42 commented on Jul 25, 2025

    @aadil42
    Contributor

    @mountiny, No problemo brother. Happy to help. Was my RCA correct? I'm new, so looking for validations from pros 😅😅.

  7. trjExpensify commented on Jul 30, 2025

    @trjExpensify
    Contributor

    @jakubkalinski0 are you working on this?

  8. jakubkalinski0 commented on Jul 30, 2025

    @jakubkalinski0
    Member

    @trjExpensify Yes, I am still working on it. Apologies for not updating earlier, I was very focused on resolving the deploy blockers.

  9. 213 remaining items

  10. mountiny commented on Jan 27, 2026

    @mountiny
    ContributorAuthor

    @aimane-chnaif can you please summarize the prs you had not been paid for yet? this will be ready to pay

  11. aimane-chnaif commented on Jan 27, 2026

    @aimane-chnaif
    Contributor
  12. mountiny commented on Jan 27, 2026

    @mountiny
    ContributorAuthor
  13. changed the title [-][Due for payment 2026-02-03] Fix console errors post React 19 upgrade[/-] [+][Due for payment 2026-02-03] [$1000] Fix console errors post React 19 upgrade[/+] on Jan 27, 2026
  14. melvin-bot commented on Jan 27, 2026

    @melvin-bot

    ⚠️ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.

  15. melvin-bot commented on Feb 3, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@trjExpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  16. trjExpensify commented on Feb 6, 2026

    @trjExpensify
    Contributor

    Payment summary as follows:

  17. trjExpensify commented on Feb 9, 2026

    @trjExpensify
    Contributor

    Awaiting offer acceptance.

  18. trjExpensify commented on Feb 9, 2026

    @trjExpensify
    Contributor

    Paid @aimane-chnaif, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions