# IGrainContext.SetComponent(TComponent?)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.igraincontext/methods/)

```csharp
public abstract void SetComponent<TComponent>(TComponent? value)
```

Sets the provided value as the component for type `TComponent`.

### Parameters

- `value` (`TComponent?`): The component instance.
