зеркало из https://github.com/microsoft/jacdac-ts.git
test component
This commit is contained in:
Родитель
1faf74aac6
Коммит
f39cbabafe
|
@ -4,7 +4,7 @@ import JacdacContext from "./Context";
|
|||
|
||||
function ConnectButton() {
|
||||
return <JacdacContext.Consumer>
|
||||
{({ bus, connectAsync, disconnectAsync }) => <Button onClick={bus ? connectAsync : disconnectAsync}>{!!bus ? "disconnect" : "connect"}</Button>}
|
||||
{({ bus, connectAsync, disconnectAsync }) => <Button onClick={!bus ? connectAsync : disconnectAsync}>{!!bus ? "disconnect jacdac" : "connect jacdac"}</Button>}
|
||||
</JacdacContext.Consumer>
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import ConnectButton from "../jacdac/ConnectButton"
|
||||
import JacdacComponent from "../jacdac/Component"
|
||||
|
||||
# Hello
|
||||
|
||||
<ConnectButton />
|
||||
|
||||
And more hello
|
||||
|
||||
<JacdacComponent>
|
||||
This text is only visible when jacdac is connected.
|
||||
</JacdacComponent>
|
||||
|
|
Загрузка…
Ссылка в новой задаче