microsoft / microsoft/react-native-windows
Array.prototype.flat() Method Breaks Application in Release Build
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 17.3k
- Forks
- 1.2k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 33
Description
Problem Description
When calling Array.prototype.flat() in a react-native-windows project, the release build is broken, while the debug build runs smoothly.
Steps To Reproduce
- As a minimal reproducible example, a component such as the following may be created:
import React from "react";
import { StyleSheet, View } from "react-native";
export default function() {
return (
<View style={[...[styles.content].flat()]} />
);
}
const styles = StyleSheet.create({
content: {
flex: 1,
},
});
(Alternatively, as a more complete example, the DropDownPicker component from the library react-native-dropdown-picker may be used in a project. Internally, the library calls Array.prototype.flat() in multiple places.)
- A debug build from the project shall be created by running:
npx react-native run-windows
The expected behavior is that in the debug build, the application runs smoothly.
- A release build from the project shall be created by running:
npx react-native run-windows --release
In the release build, the app will show a blank screen.
Expected Results
The expected behavior is that the application will show a blank screen. This depends on when the element becomes active:
- when the element is active on the initial screen, the app will start and show blank view immediately
- when the element is switched active on user interaction while the app is already running, the app will become a blank view
CLI version
10.2.2
Environment
npx react-native -v: 10.2.2
npm ls react-native-windows: react-native-windows@0.71.11
npm -v: 9.5.0
node -v: v18.15.0
msbuild version: 17.6.33815.320
<UseHermes>false</UseHermes>
Target Platform Version
10.0.19041
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
Release
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is identified. First reproduce the issue with the provided react-native-windows 0.71.11 commands, comparing debug and release behavior with Array.prototype.flat(); done means the release build no longer becomes a blank screen while the same example remains functional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native
- Domain
- build-system, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100