Replies: 1 comment
-
It seems to be an issue with
function CeoComponent() {
// 👇 triggers useIsFetching before it (<CeoComponent />) has finished rendering
const { data, status } = useQuery(["ceo", 2], fetchCeo); rendering
return (
<div className="">
<h2>dog 2</h2>
{status === "success" && data ? (
<img alt="dog ceo" src={data.message} />
) : null}
</div>
);
}
function GlobalLoadingIndicator() {
const isFetching = useIsFetching();
return (
<div className="">
<div>global isFetching: {isFetching ? "true" : "false"}</div>
</div>
);
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Can someone tell me if I'm doing something wrong here codesandbox (warning in console)
I updated React to 16.13.1 then started seeing this error: "Warning: Cannot update a component X while rendering a different component.. "
It goes away when I remove the global isFetching or downgrade react to 16.12
update: related 18178
Beta Was this translation helpful? Give feedback.
All reactions