Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flip unstable_useTransition array params + edit eslint test #52996

Merged
merged 1 commit into from May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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