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

Fluent provider react18 #1

Closed
wants to merge 6 commits into from

Conversation

micahgodbolt
Copy link
Owner

init approach of supporting fluent provider in react 18 strict mode

@@ -3,25 +3,47 @@ import * as React from 'react';
import type { FluentProviderState } from './FluentProvider.types';
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
3 participants