meshtastic/docs/software/js/connecting.mdx
Sacha Weatherstone 9dc879235f
Hardware pages (#299)
* initial devices.json

* initial hardware components

* testing page at /docs/hardware/supported/template

* WIP Changes

* Home page work & updates

* Fix build

* Fix external link button

* Setup linting

* rename, cleanup & lint

* seperate lint cmd for now

Co-authored-by: Foster Irwin <foster@jfirwin.com>
Co-authored-by: Sacha Weatherstone <sachaw100@hotmail..om>
2022-04-02 00:34:49 +11:00

25 lines
474 B
Plaintext

---
id: connecting
title: Connecting to a device
sidebar_label: Connecting
---
```tsx
import type React from 'React';
import { IHTTPConnection } from '@meshtastic/meshtasticjs';
export const Connection = (): JSX.Element => {
const connection = new IHTTPConnection();
const connect = (): void => {
void connection.connect({
address: '10.0.0.10',
fetchInterval: 3000,
});
};
return <button onClick={connect}>Connect Bluetooth</button>;
};
```