I don't understand why when I run:
interface Xxx {
str: string
}
const [xxx, setXxx] = useState<Xxx>();
function getData() {
setXxx({
str: "aaa"
});
}
getData()
then the hook is being set all the time and forever. How to run getData
once?