Skip to content

Commit

Permalink
[test] Fix issues reported by react-compiler in test packages (#42626)
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Jun 13, 2024
1 parent f610966 commit dada0ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages-internal/test-utils/src/mochaHooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe('mochaHooks', () => {
let unsafeSetState;
function Parent() {
const [state, setState] = React.useState(0);
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- unsafeSetState is required outside the component
unsafeSetState = setState;

React.useEffect(() => {});
Expand Down
1 change: 1 addition & 0 deletions test/regressions/TestViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function TestViewer(props) {
document.fonts.addEventListener('loadingdone', handleFontsEvent);

// Use a "real timestamp" so that we see a useful date instead of "00:00"
// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- useFakeTimers is not a React hook
// eslint-disable-next-line react-hooks/rules-of-hooks -- not a React hook
const clock = useFakeTimers({
now: new Date('Mon Aug 18 14:11:54 2014 -0500'),
Expand Down

0 comments on commit dada0ce

Please sign in to comment.