PageSourceSearch

https://start.starknet-react.com/assets/use-disconnect-D1msIskV.js

js starknet-react.com collected 2026-10-05 02:07:47 UTC 12,371 bytes, 75 lines download raw bytes

1import{u as r,j as s}from"./index-CW5UEyQ0.js";const l={title:"useDisconnect",description:"undefined"};function i(n){const e={a:"a",code:"code",div:"div",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",span:"span",ul:"ul",...r(),...n.components};return s.jsxs(s.Fragment,{children:[s.jsx(e.header,{children:s.jsxs(e.h1,{id:"usedisconnect",children:["useDisconnect",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usedisconnect",children:s.jsx(e.div,{"data-autolink-icon":!0})})]})}),`
2`,s.jsx(e.p,{children:"Hook for disconnecting connected StarkNet wallet."}),`
3`,s.jsxs(e.h2,{id:"usage",children:["Usage",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#usage",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
4`,s.jsx(s.Fragment,{children:s.jsx(e.pre,{className:"shiki shiki-themes github-light github-dark-dimmed twoslash lsp",style:{backgroundColor:"#fff","--shiki-dark-bg":"#22272e",color:"#24292e","--shiki-dark":"#adbac7"},tabIndex:"0",children:s.jsxs(e.code,{children:[s.jsxs(e.span,{className:"line",children:[s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"import"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:" { "}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:s.jsxs(e.span,{className:"twoslash-hover",children:[s.jsxs(e.div,{className:"twoslash-popup-info-hover",children:[s.jsxs(e.span,{className:"line",children:[s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"function"}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#DCBDFB"},children:" useDisconnect"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:"("}),s.jsx(e.span,{style:{color:"#E36209","--shiki-dark":"#F69D50"},children:"props"}),s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"?:"}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#F69D50"},children:" UseDisconnectProps"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:")"}),s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:":"}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#F69D50"},children:" UseDisconnectResult"})]}),s.jsx(e.div,{className:"twoslash-popup-jsdoc",children:s.jsx(e.p,{children:"Hook for disconnecting connected wallet."})})]}),s.jsx(e.span,{className:"twoslash-target",children:"useDisconnect"})]})}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:" } "}),s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"from"}),s.jsxs(e.span,{style:{color:"#032F62","--shiki-dark":"#96D0FF"},children:[' "@',"starknet","-","start","/","react",'"']}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:";"})]}),`
5`,s.jsx(e.span,{className:"line","data-empty-line":!0,children:" "}),`
6`,s.jsxs(e.span,{className:"line",children:[s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"const"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:" { "}),s.jsx(e.span,{style:{color:"#005CC5","--shiki-dark":"#6CB6FF"},children:s.jsxs(e.span,{className:"twoslash-hover",children:[s.jsxs(e.div,{className:"twoslash-popup-info-hover",children:[s.jsxs(e.span,{className:"line",children:[s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"const"}),s.jsx(e.span,{style:{color:"#005CC5","--shiki-dark":"#6CB6FF"},children:" disconnect"}),s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:":"}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#F69D50"},children:" UseMutateFunction"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:"<"}),s.jsx(e.span,{style:{color:"#005CC5","--shiki-dark":"#6CB6FF"},children:"void"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:", "}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#F69D50"},children:"Error"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:", "}),s.jsx(e.span,{style:{color:"#005CC5","--shiki-dark":"#6CB6FF"},children:"void"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:", "}),s.jsx(e.span,{style:{color:"#005CC5","--shiki-dark":"#6CB6FF"},children:"unknown"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:">"})]}
6),s.jsx(e.div,{className:"twoslash-popup-jsdoc",children:s.jsx(e.p,{children:"Disconnect wallet."})})]}),s.jsx(e.span,{className:"twoslash-target",children:"disconnect"})]})}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:", "}),s.jsx(e.span,{style:{color:"#005CC5","--shiki-dark":"#6CB6FF"},children:s.jsxs(e.span,{className:"twoslash-hover",children:[s.jsxs(e.div,{className:"twoslash-popup-info-hover",children:[s.jsxs(e.span,{className:"line",children:[s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"const"}),s.jsx(e.span,{style:{color:"#005CC5","--shiki-dark":"#6CB6FF"},children:" error"}),s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:":"}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#F69D50"},children:" Error"}),s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:" |"}),s.jsx(e.span,{style:{color:"#005CC5","--shiki-dark":"#6CB6FF"},children:" null"})]}),s.jsxs(e.div,{className:"twoslash-popup-jsdoc",children:[s.jsxs(e.p,{children:[`The error object for the mutation, if an error was encountered.
7Defaults to `,s.jsx(e.code,{children:"null"}),"."]}),`
8`,s.jsxs(e.p,{children:[`The error object for the mutation, if an error was encountered.
9Defaults to `,s.jsx(e.code,{children:"null"}),"."]}),`
10`,s.jsxs(e.p,{children:[`The error object for the mutation, if an error was encountered.
11Defaults to `,s.jsx(e.code,{children:"null"}),"."]}),`
12`,s.jsxs(e.p,{children:[`The error object for the mutation, if an error was encountered.
13Defaults to `,s.jsx(e.code,{children:"null"}),"."]})]})]}),s.jsx(e.span,{className:"twoslash-target",children:"error"})]})}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:" } "}),s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"="}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#DCBDFB"},children:" "}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#DCBDFB"},children:s.jsxs(e.span,{className:"twoslash-hover",children:[s.jsxs(e.div,{className:"twoslash-popup-info-hover",children:[s.jsxs(e.span,{className:"line",children:[s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"function"}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#DCBDFB"},children:" useDisconnect"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:"("}),s.jsx(e.span,{style:{color:"#E36209","--shiki-dark":"#F69D50"},children:"props"}),s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:"?:"}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#F69D50"},children:" UseDisconnectProps"}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:")"}),s.jsx(e.span,{style:{color:"#D73A49","--shiki-dark":"#F47067"},children:":"}),s.jsx(e.span,{style:{color:"#6F42C1","--shiki-dark":"#F69D50"},children:" UseDisconnectResult"})]}),s.jsx(e.div,{className:"twoslash-popup-jsdoc",children:s.jsx(e.p,{children:"Hook for disconnecting connected wallet."})})]}),s.jsx(e.span,{className:"twoslash-target",children:"useDisconnect"})]})}),s.jsx(e.span,{style:{color:"#24292E","--shiki-dark":"#ADBAC7"},children:"({});"})]})]})})}),`
14`,s.jsxs(e.h2,{id:"returns",children:["Returns",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#returns",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
15`,s.jsxs(e.h3,{id:"disconnect",children:["disconnect",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#disconnect",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
16`,s.jsxs(e.ul,{children:[`
17`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"() => void"})]}),`
18`]}),`
19`,s.jsx(e.p,{children:"Function to send the request to the user, optionally overriding the arguments to the hook."}),`
20`,s.jsxs(e.h3,{id:"disconnectasync",children:["disconnectAsync",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#disconnectasync",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
21`,s.jsxs(e.ul,{children:[`
22`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"() => Promise<void>"})]}),`
23`]}),`
24`,s.jsx(e.p,{children:"Send the request to the user and block until it receives a response."}),`
25`,s.jsxs(e.h3,{id:"data",children:["data",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#data",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
26`,s.jsxs(e.ul,{children:[`
27`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"void | undefined"})]}),`
28`]}),`
29`,s.jsx(e.p,{children:"The resolved data."}),`
30`,s.jsxs(e.h3,{id:"error",children:["error",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#error",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
31`,s.jsxs(e.ul,{children:[`
32`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"Error | null"})]}),`
33`]}),`
34`,s.jsx(e.p,{children:"Any error thrown by the mutation."}),`
35`,s.jsxs(e.h3,{id:"reset",children:["reset",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#reset",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
36`,s.jsxs(e.ul,{children:[`
37`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"() => void"})]}),`
38`]}),`
39`,s.jsx(e.p,{children:"Reset the mutation status."}),`
40`,s.jsxs(e.h3,{id:"variables",children:["variables",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#variables",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
41`,s.jsxs(e.ul,{children:[`
42`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"void | undefined"})]}),`
43`]}),`
44`,s.jsxs(e.p,{children:["The variables passed to ",s.jsx(e.code,{children:"disconnect"})," or ",s.jsx(e.code,{children:"disconnectAsync"}),"."]}),`
45`,s.jsxs(e.h3,{id:"status",children:["status",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#status",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
46`,s.jsxs(e.ul,{children:[`
47`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:'"error" | "idle" | "pending" | "success"'})]}),`
48`]}),`
49`,s.jsx(e.p,{children:"The mutation status."}),`
50`,s.jsxs(e.ul,{children:[`
51`,s.jsxs(e.li,{children:[s.jsx(e.code,{children:"idle"}),": the mutation has not been triggered yet."]}),`
52`,s.jsxs(e.li,{children:[s.jsx(e.code,{children:"pending"}),": the mutation is being executed, e.g. waiting for the user to confirm in their wallet."]}),`
53`,s.jsxs(e.li,{children:[s.jsx(e.code,{children:"success"}),": the mutation executed without an error."]}),`
54`,s.jsxs(e.li,{children:[s.jsx(e.code,{children:"error"}),": the mutation threw an error."]}),`
55`]}),`
56`,s.jsxs(e.h3,{id:"iserror",children:["isError",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#iserror",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
57`,s.jsxs(e.ul,{children:[`
58`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"boolean"})]}),`
59`]}),`
60`,s.jsxs(e.p,{children:["Derived from ",s.jsx(e.code,{children:"status"}),"."]}),`
61`,s.jsxs(e.h3,{id:"isidle",children:["isIdle",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#isidle",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
62`,s.jsxs(e.ul,{children:[`
63`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"boolean"})]}),`
64`]}),`
65`,s.jsxs(e.p,{children:["Derived from ",s.jsx(e.code,{children:"status"}),"."]}),`
66`,s.jsxs(e.h3,{id:"ispending",children:["isPending",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#ispending",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
67`,s.jsxs(e.ul,{children:[`
68`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"boolean"})]}),`
69`]}),`
70`,s.jsxs(e.p,{children:["Derived from ",s.jsx(e.code,{children:"status"}),"."]}),`
71`,s.jsxs(e.h3,{id:"issuccess",children:["isSuccess",s.jsx(e.a,{"aria-hidden":"true",tabIndex:"-1",href:"#issuccess",children:s.jsx(e.div,{"data-autolink-icon":!0})})]}),`
72`,s.jsxs(e.ul,{children:[`
73`,s.jsxs(e.li,{children:["Type: ",s.jsx(e.code,{children:"boolean"})]}),`
74`]}),`
75`,s.jsxs(e.p,{children:["Derived from ",s.jsx(e.code,{children:"status"}),"."]})]})}function c(n={}){const{wrapper:e}={...r(),...n.components};return e?s.jsx(e,{...n,children:s.jsx(i,{...n})}):i(n)}export{c as default,l as frontmatter};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.