CollectionProvider
Provides a collection store to
CollectionItem
components.
Code examples
Optional Props
defaultItems
T[] | undefined = []
The defaut value for the
items
state.
items
T[]
Lists all items along with their metadata. This state is automatically
updated when an item is registered or unregistered using the
registerItem
function.
setItems
BivariantCallback<(items: T[]) => void> | undefined
A callback that gets called when the
items
state
changes.
Code examples
const [items, setItems] = useState([]);
store
Store<Partial<S>> | undefined
Another store object that will be kept in sync with the original store.