The useReplit()
hook establishes the handshake between the Replit and the extension and passes the API wrapper for usage inside a React component.
Property | Type | Description |
---|---|---|
status | HandshakeStatus | A string indicating the status of the handshake between Replit and the Extension |
error | string | null | If the handshake has failed, error is a string indicating the error message |
filePath | string | null | If the handshake has succeeded, filePath points to the current file the user is focusing |
replit | typeof replit | If the handshake has succeeded, replit is the API wrapper for the entire @replit/extensions module |
Key | Value |
---|---|
Ready | "ready" |
Error | "error" |
Loading | "loading" |
Property | Type |
---|---|
status | HandshakeStatus .Ready |
error | null |
filePath | string |
replit | typeof replit |
Property | Type |
---|---|
status | HandshakeStatus .Loading |
error | null |
filePath | null |
replit | null |
Property | Type |
---|---|
status | HandshakeStatus .Error |
error | string |
filePath | null |
replit | null |