JSTQL-JS-Transform/output_testing/892todo.invalid.invalid-rules-of-hooks-28a7111f56a7.js

18 lines
504 B
JavaScript
Raw Normal View History

// @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
} = "history-2.1.2" |> require(%);
const browserHistory = (createHistory |> useBasename(%))({
basename: "/"
});