# getSelectedNode

**Kind:** Function

**Source:** [`atloria-monorepo/packages/editor/src/utils/lexicalHelpers.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/editor/src/utils/lexicalHelpers.ts#L29)

Gets the selected node from the Lexical editor.

## Signature

```ts
function getSelectedNode(selection: RangeSelection): TextNode | ElementNode | null
```

## Parameters

| Name | Type |
|---|---|
| `selection` | `RangeSelection` |

**Returns:** `TextNode | ElementNode | null`
