function FastAndHighPriorityComponent() { const [someData, changeData] = useState(0); return ({ iNeedThisUpdateAsSoonAsPossible(() =>changeData(prevData => prevData + 1) ); }} >Fast and high priority change); }
function App() { return (); }
// If the user clicks first the SlowButLowPriorityComponent button // and then the FastAndHighPriorityComponent button // React will stop rendering SlowButLowPriorityComponent // and finish rendering FastAndHighPriorityComponent (with its new state) first // only then it will continue with the SlowButLowPriorityComponent update
import { dontRenderMeUntilThisIsReady, Suspense as TryRenderTheseChildren } from "fictitious-react"; import getMyDependency from "fictitious-dependency-fetcher";