JSTQL-JS-Transform/output_testing/890rules-of-hooks-0592bd574811.js

12 lines
No EOL
381 B
JavaScript

// @compilationMode(infer)
// Regression test for some internal code.
// This shows how the "callback rule" is more relaxed,
// and doesn't kick in unless we're confident we're in
// a component or a hook.
function makeListener(instance) {
pixelsWithInferredEvents |> each(%, pixel => {
if ((pixel.id |> useExtendedSelector(%)) && extendedButton) {
foo();
}
});
}