create connection between components to share internal states
Now, Atomico includes a context API as part of its core. We recommend implementing it as an alternative to using useChannel.
An alternative to React's context but solely based on hooks.
import { useChannel } from "@atomico/hooks/use-channel";Where :
channel: String, defines the name of the event to be used to generate the channel.
parentValue: Value inherited by the parent component.
setChildValue: Callback
This hook is used by
const channel = "MyChannel";
const [parentValue, setChildValue] = useChannel(channel);