Skip to content

Commit

Permalink
Add type arguments to calls to new Array() in xplat
Browse files Browse the repository at this point in the history
Summary:
This diff adds type parameters to all uses of `new Array`.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D41746116

fbshipit-source-id: 8aa2777dd13ef4cd9f8613adaa3509d3573d4446
  • Loading branch information
mvitousek authored and facebook-github-bot committed Dec 7, 2022
1 parent ccefad0 commit 78b599f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-native-codegen/src/generators/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function indent(nice: string, spaces: number): string {
if (line.length === 0 || index === 0) {
return line;
}
const emptySpaces = new Array(spaces + 1).join(' ');
const emptySpaces = new Array<mixed>(spaces + 1).join(' ');
return emptySpaces + line;
})
.join('\n');
Expand Down
2 changes: 1 addition & 1 deletion packages/rn-tester/js/examples/Text/TextExample.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ class TextRenderInfoExample extends React.Component<
this.setState({textMetrics: lines[lines.length - 1]});
}
}}>
{new Array(this.state.numberOfTextBlocks)
{new Array<string>(this.state.numberOfTextBlocks)
.fill('A tiny block of text.')
.join(' ')}
</Text>
Expand Down

0 comments on commit 78b599f

Please sign in to comment.