-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
apiIssues related to APIIssues related to APIbugSomething isn't workingSomething isn't workingstatus: fixed in next releaseThe issue will be closed once next release is availableThe issue will be closed once next release is available
Description
Description
The withAccessToken has worked fine previously however has started causing issues with react state and triggering the following error message Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.
Steps To Reproduce
- Wrap any component in the withAccessToken like so:
import { List } from "@raycast/api";
import { OAuthService, withAccessToken } from "@raycast/utils";
function Command() {
return (
<List>
<List.Item title="Hello" />
</List>
);
}
const google = OAuthService.google({
clientId: "", // redacted for privacy reasons
scope: "https://www.googleapis.com/auth/userinfo.email",
});
export default withAccessToken(google)(Command);- npm run dev
- Error should appear after running the command
Current Behaviour
Error message appears and inconsistent useState hooks behaviour with the List searchText prop.
Expected Behaviour
No error messages when running
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apiIssues related to APIIssues related to APIbugSomething isn't workingSomething isn't workingstatus: fixed in next releaseThe issue will be closed once next release is availableThe issue will be closed once next release is available