# ToComponentDataArray<T>(AllocatorHandle)

> Creates a NativeArray containing the components of type T for the selected entities.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public NativeArray<T> ToComponentDataArray<T>(AllocatorManager.AllocatorHandle allocator) where T : unmanaged, IComponentData
```

### Parameters

**** (\[AllocatorHandle]\(/engine/7000.0/script-reference/unity/collections/allocatormanager/allocatorhandle)): The type of memory to allocate.

### Returns

| Type                                                                                 | Description                                                                                   |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- |
| [NativeArray\<T>](/engine/7000.0/script-reference/unity/collections/nativearray1.md) | An array containing the specified component for all the entities selected by the EntityQuery. |

### Remarks

This version of the function blocks on all registered jobs against the relevant query components. For a non-blocking variant, see [EntityQuery.ToComponentDataListAsync](/engine/7000.0/script-reference/unity/entities/entityquery/tocomponentdatalistasync.md)
