Add option to generate a single snapshot view from CLI (#56071)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56071

Changelog: [Internal]

Adds `--view` argument to the snapshot generator, which allows to generate a single snapshot view instead of all of them.

Reviewed By: cipolleschi

Differential Revision: D96280524

fbshipit-source-id: 6ebf3689e7b0256ba54c3d5a8e1dd602b044ec02
This commit is contained in:
Dawid Małecki authored and meta-codesync[bot] committed 2026-03-18 09:29:02 -07:00
1 parent 248d38e5c1
commit e6f0724c4e
1 file changed
+8
+8
View File
@@ -198,6 +198,11 @@ def main():
type=str,
help="Directory containing committed snapshots for comparison (used with --check)",
)
parser.add_argument(
"--view",
type=str,
help="Name of the API view to generate",
)
parser.add_argument(
"--test",
action="store_true",
@@ -250,6 +255,9 @@ def main():
def build_snapshots(output_dir: str, verbose: bool) -> None:
if not args.test:
for config in snapshot_configs:
if args.view and config.snapshot_name != args.view:
continue
build_snapshot_for_view(
api_view=config.snapshot_name,
react_native_dir=react_native_package_dir,