Skip to content

Commit

Permalink
Add explicit React useState annotations in xplat/js
Browse files Browse the repository at this point in the history
Reviewed By: SamChou19815

Differential Revision: D39756144

fbshipit-source-id: d34c86b62e82e771723714fb7896058b7f27670f
  • Loading branch information
pieterv authored and facebook-github-bot committed Sep 23, 2022
1 parent 65b2be3 commit 17c63a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ function useLoadMore<TQuery: OperationType>(args: {
>,
}): [LoadMoreFn<TQuery>, boolean, () => void] {
const {disableStoreUpdates, enableStoreUpdates, ...loadMoreArgs} = args;
const [requestPromise, setRequestPromise] = useState(null);
const [requestPromise, setRequestPromise] = useState<null | Promise<mixed>>(
null,
);
const requestPromiseRef = useRef(null);
const promiseResolveRef = useRef(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ describe('ReactRelayTestMocker with Containers', () => {

function FeedbackComponent(props: $FlowFixMe) {
const [busy, setBusy] = useState(false);
const [errorMessage, setErrorMessage] = useState(null);
const [errorMessage, setErrorMessage] = useState<null | string>(null);
return (
<div>
{errorMessage != null && (
Expand Down

0 comments on commit 17c63a1

Please sign in to comment.