# Reconnect

The provider comes with a `reconnect` action that establishes a new connection to WalletConnect (with an existing or stored session).&#x20;

```typescript
// Some where within your codebase...

const { actions } = useProvider();

const response = await actions.reconnect(session)
```

#### Input

This action requires the session to reconnect.

```typescript
session: SessionTypes.Struct // WalletConnect Session
```

#### Return Type

The method will resolve if a connection is re-established by the user.

<pre class="language-typescript"><code class="lang-typescript"><strong>Promise&#x3C;void>
</strong></code></pre>

#### Example usage:

```jsx
// File: ./src/app/component.tsx
'use client';

import * as React from 'react';
import { useProvider } from './page';

export default function Component() {
  const { actions, session, accounts } = useProvider();

  const handleReconnect = async () => {
    const response = await actions.reconnect(session);
    if (response.error) throw response.error;
    // You have been connected using wallet connect.
    // Now you can start interacting with the XRP Ledger.
    // ...
  };

  return (
    <div>
      <button type="button" onClick={handleReconnect}>
        Reconnect
      </button>
      {session && (
        <div>
           <span>Successfully connected!</span>
              {accounts && accounts.map((account,index) => (
		<div key={index}>{account}</div>
	      )
            )}
        </div>
      )}
    </div>
  );
}
```
