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

Incompatible with React 19 #31

Open
daniharo opened this issue May 24, 2024 · 2 comments
Open

Incompatible with React 19 #31

daniharo opened this issue May 24, 2024 · 2 comments

Comments

@daniharo
Copy link

This library makes use of React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, which is removed in React 19.

Therefore, when trying to use it with React 19, you get "TypeError: Cannot read properties of undefined (reading 'ReactCurrentOwner')".

Reproduction: https://codesandbox.io/p/sandbox/fluentui-react-components-with-react-19-g4g5pw?file=%2Fsrc%2FApp.tsx

The error happens here:

export const getCurrentOwner = () =>
// @ts-ignore - using react internals
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner
.current;

@ling1726
Copy link
Member

#32 should fix the throwing in React 19. However, there are still two tests that fail due to effect ordring differences. Will need to look further there

@layershifter
Copy link
Member

Seems that Next.js with their canary versions is also affected, microsoft/fluentui#31930.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants