Skip to content

Conversation

@micahgodbolt
Copy link
Owner

init approach of supporting fluent provider in react 18 strict mode

import { fluentProviderClassNames } from './useFluentProviderStyles';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const useInsertionEffect = (React as any)['useInsertion' + 'Effect'];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a comment here that explains why we write this as ['useInsertion' + 'Effect'].

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be honest, i'm not sure if it is necessary as this repo has different rules than griffel

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case it's worth experimenting with a CRA app to see if we need to do this. In the linked Emotion issue the problem didn't pop up in Emotion but in a consumer of Emotion using React 17.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will cause problems on consumer side, please check microsoft#23625 (comment)

@micahgodbolt
Copy link
Owner Author

closing this as it was just a test run

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

Successfully merging this pull request may close these issues.

4 participants