# RefRO<T>

> ReadOnlyRef stores a safe read-only reference to a component data.

## Definition

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

```csharp
public readonly struct RefRO<T> : IQueryTypeParameter where T : struct, IComponentData
```

## Constructors

| Constructor                                                                                                                 | Description                                                                      |
| --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [RefRO\`1(Unity.Collections.NativeArray\{\`0},System.Int32)](/engine/7000.0/script-reference/unity/entities/refro1/ctor.md) | Stores a safe reference to a component from an array of components at the index. |

## Properties

| Property                                                                    | Description                                                            |
| --------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [IsValid](/engine/7000.0/script-reference/unity/entities/refro1/isvalid.md) | Property that returns true if the reference is valid, false otherwise. |
| [ValueRO](/engine/7000.0/script-reference/unity/entities/refro1/valuero.md) | Returns a read-only reference to the component value itself.           |

## Static Methods

| Method                                                                        | Description                                                                                                                     |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| [Optional](/engine/7000.0/script-reference/unity/entities/refro1/optional.md) | Stores a safe reference to a component from an array of components at the index. If the array is empty stores a null reference. |
