Skip to content

Use a single version of React #1890

Open
@emteknetnz

Description

@emteknetnz

There's an issue that often shows up when using react hooks in functional components that is apparently is a result of using multiple versions of react, despite them all being 18.2.0

We can work around this by using class components instead of functional components, however as time goes on this becomes less viable.

This seems to be resolvable by only including react (and react-dom etc) within silverstripe/admin and make it exposed/external with webpack and getting other modules such as asset-admin to use that

There is a slightly complication with anything that doesn't use admin such as silverstripe/login-forms and silverstripe/mfa because admin hasn't loaded, so react will still probably need to be required there, or at least it needs to expose a seperate dist file with react in it

silverstripe/mfa can be use both outside of admin as part of logging in, or inside of admin when adding new methods from the update user details form, so it will be the most complex use case

Notes

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions