15 lines
323 B
JavaScript
15 lines
323 B
JavaScript
|
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]);
|
||
|
}
|