Show API reference for

The cleanup function returned by a Streamlit v2 component.

This type represents the cleanup function that your component can return from its top-level export default function. If provided, Streamlit will call this function when your component is unmounted from the app, allowing you to perform any necessary cleanup tasks, such as removing event listeners or canceling network requests.

(TypeScript) Type alias description[source]

CleanupFunction = () => void

forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.