mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
975181512c
Closes #25918. Supersedes #25919. References react/react#37234. AI-assisted.
35 lines
621 B
Plaintext
35 lines
621 B
Plaintext
---
|
|
source: crates/oxc_react_compiler/tests/snapshot.rs
|
|
input_file: crates/oxc_react_compiler/fixtures/capturing-func-alias-computed-mutate.js
|
|
---
|
|
import { c as _c } from "react/compiler-runtime";
|
|
import { mutate } from "shared-runtime";
|
|
function Component(t0) {
|
|
const $ = _c(2);
|
|
const { a } = t0;
|
|
let y;
|
|
if ($[0] !== a) {
|
|
const x = { a };
|
|
y = {};
|
|
const f0 = function() {
|
|
y["x"] = x;
|
|
};
|
|
f0();
|
|
mutate(y);
|
|
$[0] = a;
|
|
$[1] = y;
|
|
} else {
|
|
y = $[1];
|
|
}
|
|
return y;
|
|
}
|
|
export const FIXTURE_ENTRYPOINT = {
|
|
fn: Component,
|
|
params: [{ a: 2 }],
|
|
sequentialRenders: [
|
|
{ a: 2 },
|
|
{ a: 2 },
|
|
{ a: 3 }
|
|
]
|
|
};
|