Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/destructuring-default-at-explicit-null.expect.md
2026-08-27 21:09:14 +00:00

555 B

Input

function Component(props) {
  // destructure slot index has an explicit null in the input, should return null (not the default)
  const [x = 42] = props.value;
  return x;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{value: [null]}],
};

Code

function Component(props) {
  const [t0] = props.value;
  const x = t0 === undefined ? 42 : t0;
  return x;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{ value: [null] }],
};

Eval output

(kind: ok) null