Skip to content

ESLint Errors with <React.StrictMode> and <React.Fragment> in Fluent UI #136

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

Open
otkHsiao opened this issue Apr 15, 2025 · 0 comments
Open

Comments

@otkHsiao
Copy link

Hi @aubreyquinn,

First of all, thank you for your amazing work on this project! I recently encountered an issue with the ESLint plugin when using <React.StrictMode> or <React.Fragment> in my code.

Here is the code snippet that triggers the error:

const render = (Component) => {
    ReactDOM.render(
        <React.StrictMode>
            <FluentProvider theme={themeV9} style={rootStyle} applyStylesToPortals={false}>
                <Component />
            </FluentProvider>
        </React.StrictMode>,
        document.getElementById("container"),
    );
};

The ESLint errors are as follows:

ensure AccordionItem has exactly one header and one panel eslint@microsoft/fluentui-jsx-a11y/accordion-item-needs-header-and-panel
ensure DialogBody has exactly one header, one content, and one footer eslint@microsoft/fluentui-jsx-a11y/dialogbody-needs-title-content-and-actions
I wanted to check if this is a misidentification by the ESLint plugin or if there is a known solution to this issue.

Thank you in advance for your time and effort, and I appreciate any insights you can provide!

Best regards.

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

1 participant