The Developer Preview for Android 11 is now available; test it out and share your feedback.

CompositionReference

interface CompositionReference
androidx.compose.CompositionReference

A CompositionReference is an opaque type that is used to logically "link" two compositions together. The CompositionReference instance represents a reference to the "parent" composition in a specific position of that composition's tree, and the instance can then be given to a new "child" composition. This reference ensures that invalidations and ambients flow logically through the two compositions as if they were not separate.

Summary

Public methods

abstract T

abstract AmbientMap

abstract Unit

abstract Unit
registerComposer(composer: Composer<N>)

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Public methods

getAmbient

abstract fun <T> getAmbient(key: Ambient<T>): T

getAmbientScope

abstract fun getAmbientScope(): AmbientMap

invalidate

abstract fun invalidate(): Unit

registerComposer

abstract fun <N> registerComposer(composer: Composer<N>): Unit