Skip to content

Commit

Permalink
Flip unstable_useTransition array params + edit eslint test (#52996)
Browse files Browse the repository at this point in the history
  • Loading branch information
damikun committed May 18, 2021
1 parent dca2fc2 commit 7046ebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions types/react/experimental.d.ts
Expand Up @@ -142,16 +142,16 @@ declare module '.' {
*
* The `useTransition` hook returns two values in an array.
*
* The first is a function that takes a callback. We can use it to tell React which state we want to defer.
* The seconda boolean. It’s React’s way of informing us whether we’re waiting for the transition to finish.
* The first is boolean, React’s way of informing us whether we’re waiting for the transition to finish.
* The seconda is a function that takes a callback. We can use it to tell React which state we want to defer.
*
* **If some state update causes a component to suspend, that state update should be wrapped in a transition.**
*
* @param config An optional object with `timeoutMs`
*
* @see https://reactjs.org/docs/concurrent-mode-reference.html#usetransition
*/
export function unstable_useTransition(): [TransitionStartFunction, boolean];
export function unstable_useTransition(): [boolean, TransitionStartFunction];

const opaqueIdentifierBranding: unique symbol;
/**
Expand Down
2 changes: 1 addition & 1 deletion types/react/test/experimental.tsx
Expand Up @@ -5,7 +5,7 @@ import React = require('react');
function useExperimentalHooks() {
const [toggle, setToggle] = React.useState(false);

const [startTransition, done] = React.unstable_useTransition();
const [done, startTransition] = React.unstable_useTransition();
// $ExpectType boolean
done;

Expand Down

0 comments on commit 7046ebd

Please sign in to comment.