Skip to content

Instantly share code, notes, and snippets.

@jonastreub
jonastreub / Store.ts
Last active April 1, 2024 10:11
Share state between Framer components using a Store
import * as React from "react"
// For sharing a search string among components
// export const searchStore = new Store("");
// Register class components on mount
// componentDidMount() { searchStore.registerComponent(this) }
// And unregister on unmount
// componentWillUnmount() { searchStore.unregisterComponent(this) }