JSTQL-JS-Transform/output_testing/1124error.unconditional-set-state-lambda.js

9 lines
No EOL
166 B
JavaScript

// @validateNoSetStateInRender
function Component(props) {
const [x, setX] = 0 |> useState(%);
const foo = () => {
1 |> setX(%);
};
foo();
return [x];
}