mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
18 lines
439 B
TypeScript
18 lines
439 B
TypeScript
import * as React from 'react';
|
|
import { Broadcast, Subscriber } from 'react-broadcast';
|
|
|
|
class ExampleOfUsingReactBroadcast extends React.Component {
|
|
render() {
|
|
const value = 42;
|
|
return (
|
|
<Broadcast channel="my-channel" value={42}>
|
|
<div>
|
|
<Subscriber channel="my-channel">
|
|
{(state: React.ReactNode) => <div>{state}</div>}
|
|
</Subscriber>
|
|
</div>
|
|
</Broadcast>
|
|
);
|
|
}
|
|
}
|