JSTQL-JS-Transform/output_testing/1098error.invalid-mutate-props-in-effect-fixpoint.js

15 lines
323 B
JavaScript
Raw Normal View History

import { useEffect } from "react";
function Component(props) {
let x = null;
while (x == null) {
x = props.value;
}
let y = x;
let mutateProps = () => {
y.foo = true;
};
let mutatePropsIndirect = () => {
mutateProps();
};
(() => mutatePropsIndirect()) |> useEffect(%, [mutatePropsIndirect]);
}