Hook & SupplyChainProvider

Through the useSupplyChainContext hook, users gain access to the supply chain model, allowing them to utilize its functions for further customization of the interaction with the diagram.

This hook is accessible only when used in a child component of a SupplyChainProvider. This condition is consistently met when implementing child components for the SupplyChain component. However, if the hook is called outside the supply chain component, the SupplyChainProvider must be a common ancestor.

The following example demonstrates how to use the hook for a button in a sidebar or a customized context menu.