---
title: "StateFactoryMarker"
description: "Designates a function as a factory function that produces a State object. Since State factory
functions create and initialize a state, they should usually only be called once per state value
initialization. This annotation causes all invocations of marked state factory functions to be
checked to ensure that they are not called directly inside the body of a
[androidx.compose.runtime.Composable] function and are instead wrapped with an appropriate
[androidx.compose.runtime.remember] call."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
@MustBeDocumented
@Target(AnnotationTarget.FUNCTION)
public annotation class StateFactoryMarker
```


Designates a function as a factory function that produces a State object. Since State factory
functions create and initialize a state, they should usually only be called once per state value
initialization. This annotation causes all invocations of marked state factory functions to be
checked to ensure that they are not called directly inside the body of a
`androidx.compose.runtime.Composable` function and are instead wrapped with an appropriate
`androidx.compose.runtime.remember` call.



