Skip to content

ReactSDK: FusionAuth odd/broken strict mode #178

@Kanedsodas

Description

@Kanedsodas

Description

When developing with FusionAuth, if React's strict mode is enabled it has some incorrect or just broken behavior depending on what React version is being used (18 or 19).

In React 19

The dispose function here is triggered, what's weird is it seems to (I think) keep using the same object it just disposed instead of the newly created one. I only noticed when shouldAutoRefresh wouldn't work.
My main.tsx file is essentially the same as this one.

In React 18

Strict mode also seems to have incorrect behavior here in that dispose is never called. This is easiest to see in that 2 refresh requests are send instead of 1. Though this may not be a problem, I didn't look too far into it on this version.

Affects package

React SDK

Affects versions

2.4.3

This is at least partially related to #97.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions