Library
React Components / v9 (@fluentui/react-components)
System Info
PS C:\Projects\fluent-ui-jsx-runtime> npx envinfo --system --npmPackages '{@fluent/*}' --browsers
Need to install the following packages:
envinfo@7.10.0
Ok to proceed? (y)
System:
OS: Windows 10 10.0.22631
CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
Memory: 5.75 GB / 31.79 GB
Browsers:
Edge: Spartan (44.22621.2262.0), Chromium (116.0.1938.69)
Internet Explorer: 11.0.22621.1
Are you reporting Accessibility issue?
no
Reproduction
https://github.com/vlaskal/fluent-ui-v9-jsx-runtime-issue
Bug Description
I want to customize AccordionHeader component via Slot API when we want to override default rendering of button slot. I followed the documentation Replacing-the-entire-slot and I came with the following code:
const headerRenderer = (Inner, innerProps) => {
return (
<>
<Inner {...innerProps} />
<div ... >
<Button ... >Insert</Button>
</div>
</>
);
}
<AccordionHeader button={{ children: headerRenderer }} ... > ... </AccordionHeader>
More can be found in InsertItem.tsx file in linked repository.
This code works as expected in production build and also works without any problems in development build npm run dev on Vite + React based project till version 9.30.1 of @fluentui/react-components package. To be more precise, it works without issue till version 9.3.7of @fluentui/react-accordion package.
Actual Behavior
In version 9.30.2 of @fluentui/react-components respectively 9.3.8 of @fluentui/react-accordion and later is behavior change in development build. Browser Console log is flooded by following error:
Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17
at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21)
at InsertActionItem1
at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43)
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17
at App
at div
at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3)
at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17
Application works fine but any other errors or warnings are hidden by them. You can check it in attached repository project by following steps:
- npm install
- npm run dev
- Open application in browser
- Open console log in browser
- Refresh it
- A lot of errors are generated
Expected Behavior
Development build will not produce additional errors or warnings as was in versions 9.30.1 of @fluentui/react-components respectively 9.3.7 of @fluentui/react-accordion.
This behavior can be checked in attached repository project by following steps:
- Update version of
@fluentui/react-accordion package to 9.3.7
- npm install
- npm run dev
- Open application in browser
- Open console log in browser
- Refresh it
- No errors are generated
Additional Info
I think following PRs #28943, #28959 and #28962 can be source of changed behaviour.
Logs
installHook.js:251
Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17
at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21)
at InsertActionItem1
at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43)
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17
at App
at div
at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3)
at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17
react-jsx-runtime.development.js:87
Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17
at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21)
at InsertActionItem2
at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43)
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17
at App
at div
at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3)
at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17
installHook.js:251
Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17
at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21)
at InsertActionItem2
at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43)
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17
at App
at div
at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3)
at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17
react-jsx-runtime.development.js:87
Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17
at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21)
at InsertActionItem3
at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43)
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17
at App
at div
at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3)
at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17
installHook.js:251
Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17
at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21)
at InsertActionItem3
at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43)
at div
at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17
at App
at div
at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3)
at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17
Requested priority
Normal
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations
Library
React Components / v9 (@fluentui/react-components)
System Info
Are you reporting Accessibility issue?
no
Reproduction
https://github.com/vlaskal/fluent-ui-v9-jsx-runtime-issue
Bug Description
I want to customize
AccordionHeadercomponent via Slot API when we want to override default rendering ofbuttonslot. I followed the documentation Replacing-the-entire-slot and I came with the following code:More can be found in
InsertItem.tsxfile in linked repository.This code works as expected in production build and also works without any problems in development build
npm run devon Vite + React based project till version9.30.1of@fluentui/react-componentspackage. To be more precise, it works without issue till version9.3.7of@fluentui/react-accordionpackage.Actual Behavior
In version
9.30.2of@fluentui/react-componentsrespectively9.3.8of@fluentui/react-accordionand later is behavior change in development build. BrowserConsole logis flooded by following error:Application works fine but any other errors or warnings are hidden by them. You can check it in attached repository project by following steps:
Expected Behavior
Development build will not produce additional errors or warnings as was in versions
9.30.1of@fluentui/react-componentsrespectively9.3.7of@fluentui/react-accordion.This behavior can be checked in attached repository project by following steps:
@fluentui/react-accordionpackage to9.3.7Additional Info
I think following PRs #28943, #28959 and #28962 can be source of changed behaviour.
Logs
installHook.js:251 Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead. at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17 at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17 at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21) at InsertActionItem1 at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43) at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17 at App at div at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3) at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17 react-jsx-runtime.development.js:87 Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead. at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17 at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17 at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21) at InsertActionItem2 at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43) at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17 at App at div at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3) at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17 installHook.js:251 Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead. at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17 at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17 at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21) at InsertActionItem2 at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43) at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17 at App at div at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3) at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17 react-jsx-runtime.development.js:87 Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead. at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17 at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17 at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21) at InsertActionItem3 at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43) at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17 at App at div at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3) at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17 installHook.js:251 Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead. at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:35834:17 at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14299:17 at InsertItem (http://localhost:5174/src/InsertItem.tsx:27:21) at InsertActionItem3 at Provider2 (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:2730:43) at div at http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:14202:17 at App at div at TextDirectionProvider (http://localhost:5174/node_modules/.vite/deps/chunk-4OIPOZFD.js?v=c1559de4:13884:3) at http://localhost:5174/node_modules/.vite/deps/@fluentui_react-components.js?v=40c2882c:1309:17 Requested priority
Normal
Products/sites affected
No response
Are you willing to submit a PR to fix?
yes
Validations