Reactjs – How to solve Race condition in setting React state?
I have component that have state as object const [data, setData] = useState({ input, output: '', enableCopyToClipboard: true, } When listen to Observable I do following: // reset state before loading stream setData({ ...data, output: '', enableCopyToClipboard: false, }); loadingStream(request).subscribe((response)…