MCPcopy
hub / github.com/facebook/react / App

Function App

packages/react-reconciler/src/__tests__/ReactTransition-test.js:174–184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172 it('isPending works even if called from outside an input event', async () => {
173 let start;
174 function App() {
175 const [show, setShow] = useState(false);
176 const [isPending, _start] = useTransition();
177 start = () => _start(() => setShow(true));
178 return (
179 <Suspense fallback={<Text text="Loading..." />}>
180 {isPending ? <Text text="Pending..." /> : null}
181 {show ? <AsyncText text="Async" /> : <Text text="(empty)" />}
182 </Suspense>
183 );
184 }
185
186 const root = ReactNoop.createRoot();
187

Callers

nothing calls this directly

Calls 4

startTransitionFunction · 0.85
useStateFunction · 0.50
useTransitionFunction · 0.50
useLayoutEffectFunction · 0.50

Tested by

no test coverage detected