Github
Twitter
Discord
Playground
Search…
English
👋
Atomico
🚀
Getting started with Atomico
Api
🧬
Props(Properties)
🧩
VirtualDOM
🎣
Hooks
🔬
Testing
Guides
🧠
Atomico design patterns
🗺
Atomico style guide
🛡
Atomico with Typescript
🤝
Atomico and React
🔀
Slot
🗃
Archives
@atomico
@atomico/store
@atomico/design-tokens
@atomico/router
@atomico/react
@atomico/hooks
use-ref-values
use-script
use-attributes
use-prop-proxy
use-click-press
use-dollars
use-reflect-event
use-keyboar
use-click-coordinates
use-copy
use-debounce-state
use-form
use-listener
use-disabled
use-css
use-channel
use-promise
use-responsive-state
use-parent
use-resize-observer
use-slot
use-render
use-mutation-observer
use-css-light-dom
use-controller
use-router
use-async-effect
use-child-nodes
use-force-render
@atomico/components
@atomico/exports
@atomico/magic-form
Support
Discord
Github
Twitter
Powered By
GitBook
use-channel
create connection between components to share internal states
Este hook implementa
@atomico/channel
una alternativa a React.Context, pero basada en eventos y agnóstica.
Modulo
1
import
{
useChannel
}
from
"@atomico/hooks/use-channel"
;
Copied!
Syntax
1
const
channel
=
"MyChannel"
;
2
const
[
parentValue
,
setChildValue
]
=
useChannel
(
channel
);
Copied!
Where :
1.
channel
:
String
, defines the name of the event to be used to generate the channel.
2.
parentValue
: Value inherited by the parent component.
3.
setChildValue
:
Callback
, defines a value for nested components.
Example
WebComponents.dev
WebComponents.dev
This hook is used by
@atomico/components/router
Previous
use-css
Next
use-promise
Last modified
2mo ago
Copy link
Edit on GitHub
Contents
Modulo
Syntax
Example