Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/use-no-forget-multiple-with-eslint-suppression.expect.md
2026-08-27 21:09:14 +00:00

830 B

Input

import {useRef} from 'react';

const useControllableState = options => {};
function NoopComponent() {}

function Component() {
  'use no forget';
  const ref = useRef(null);
  // eslint-disable-next-line react-hooks/rules-of-hooks
  ref.current = 'bad';
  return <button ref={ref} />;
}

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

Code

import { useRef } from "react";

const useControllableState = (options) => {};
function NoopComponent() {}

function Component() {
  "use no forget";
  const ref = useRef(null);
  // eslint-disable-next-line react-hooks/rules-of-hooks
  ref.current = "bad";
  return <button ref={ref} />;
}

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

Eval output

(kind: ok)