The component's return type, which can be a cleanup function or void.
| (TypeScript) Type alias description[source] | |
|---|---|
OptionalComponentCleanupFunction = ComponentCleanupFunction | void |
The cleanup function returned by a Streamlit v2 Component.
This type alias isn't exported. Use OptionalComponentCleanupFunction instead.
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] | |
|---|---|
ComponentCleanupFunction = () => void |
Still have questions?
Our forums are full of helpful information and Streamlit experts.
