# code/editor/HighlightWorkers (zidane-ui/code/editor)

Import: `import { … } from 'zidane-ui/code/editor'`. Source: [ui/src/code/editor/HighlightWorkers.tsx](https://github.com/Tahul/zidane/blob/main/ui/src/code/editor/HighlightWorkers.tsx).

## Components

### `HighlightWorkers`

Component.

Gives the views below a shared pool of highlight workers themed like the editor. Without a
`createWorker` it renders the children as they are and pierre highlights on the main thread.

```ts
function HighlightWorkers(props: HighlightWorkersProps): Element
```

**Parameters**

- `props` (`HighlightWorkersProps`): See [`HighlightWorkersProps`](https://zidane.si/docs/reference/ui-code-editor-highlight-workers.md#HighlightWorkersProps).

**Returns** `Element`

**Props**

- `children` (`ReactNode`): The views that highlight through the pool.
- `createWorker` (`(() => Worker) | null`): Creates one highlight worker; `null` (no Worker in this environment) highlights on the main thread.

Source: [ui/src/code/editor/HighlightWorkers.tsx:44](https://github.com/Tahul/zidane/blob/main/ui/src/code/editor/HighlightWorkers.tsx#L44)

## Interfaces

### `HighlightWorkersProps`

Interface.

Props of [`HighlightWorkers`](https://zidane.si/docs/reference/ui-code-editor-highlight-workers.md#HighlightWorkers).

```ts
interface HighlightWorkersProps
```

**Properties**

- `children` (`ReactNode`): The views that highlight through the pool.
- `createWorker` (`(() => Worker) | null`): Creates one highlight worker; `null` (no Worker in this environment) highlights on the main thread.

Source: [ui/src/code/editor/HighlightWorkers.tsx:31](https://github.com/Tahul/zidane/blob/main/ui/src/code/editor/HighlightWorkers.tsx#L31)
