diff --git a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-post-increment-assignment.js b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-post-increment-assignment.js new file mode 100644 index 00000000000..da043d92bee --- /dev/null +++ b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-post-increment-assignment.js @@ -0,0 +1,13 @@ +function Component(props) { + const items = [0, 1, 2]; + return items.reduce((agg, item) => { + const current = agg.count++; + agg.res.push(current); + return agg; + }, {count: 0, res: []}); +} + +export const FIXTURE_ENTRYPOINT = { + fn: Component, + params: [{}], +}; diff --git a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-update-expression-captured-variable.js b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-update-expression-captured-variable.js new file mode 100644 index 00000000000..628a0657a2d --- /dev/null +++ b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/todo-update-expression-captured-variable.js @@ -0,0 +1,13 @@ +function Component() { + let x = 0; + const inc = () => { + x++; + }; + inc(); + return x; +} + +export const FIXTURE_ENTRYPOINT = { + fn: Component, + params: [], +};