Description
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
- See https://github.com/silverstripe/silverstripe-asset-admin/pull/1537/files#r1926201673 for a change that may need to be made to .eslintc.js for a bunch of modules