Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/merge-consecutive-scopes-deps-subset-of-decls.js
2026-08-27 21:09:14 +00:00

22 lines
561 B
JavaScript

import {useState} from 'react';
function Component() {
const [count, setCount] = useState(0);
return (
<div>
<button onClick={() => setCount(count - 1)}>Decrement</button>
{/**
* The scope for the <button> depends on just the scope for the callback,
* but the previous scope (after merging) will declare both the above
* <button> and the callback.
*/}
<button onClick={() => setCount(count + 1)}>Increment</button>
</div>
);
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{}],
};