Home / File/ todo.invalid.invalid-rules-of-hooks-28a7111f56a7.js — react Source File

todo.invalid.invalid-rules-of-hooks-28a7111f56a7.js — react Source File

Architecture documentation for todo.invalid.invalid-rules-of-hooks-28a7111f56a7.js, a javascript file in the react codebase.

Entity Profile

Source Code

// @expectNothingCompiled @skip
// Passed but should have failed

// Technically this is a false positive.
// We *could* make it valid (and it used to be).
//
// However, top-level Hook-like calls can be very dangerous
// in environments with inline requires because they can mask
// the runtime error by accident.
// So we prefer to disallow it despite the false positive.

const {createHistory, useBasename} = require('history-2.1.2');
const browserHistory = useBasename(createHistory)({
  basename: '/',
});

Frequently Asked Questions

What does todo.invalid.invalid-rules-of-hooks-28a7111f56a7.js do?
todo.invalid.invalid-rules-of-hooks-28a7111f56a7.js is a source file in the react codebase, written in javascript.
Where is todo.invalid.invalid-rules-of-hooks-28a7111f56a7.js in the architecture?
todo.invalid.invalid-rules-of-hooks-28a7111f56a7.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks/todo.invalid.invalid-rules-of-hooks-28a7111f56a7.js (directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/rules-of-hooks).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free