@dxos/react-client
TypeScript icon, indicating that this package has built-in type declarations

0.4.9 • Public • Published

@dxos/react-client

React client API

Installation

pnpm i @dxos/react-client

Usage

The snippet below illustrates a self-contained DXOS application that uses providers to create the client and instantiate a user profile.

import React from 'react';
import { useClient, ClientProvider } from '@dxos/react-client';
import { createRoot } from 'react-dom/client';

const App = () => {
  const client = useClient();
  const space = useSpaces();
  return (
    <pre>{JSON.stringify(client.info())}</pre>
  );
};

const Root = () => (
  <ClientProvider>
    <App />
  </ClientProvider>
);

createRoot(document.getElementById('root')!)
  .render(<Root/>);

Documentation

Storybooks

The HALO Invitation Story demonstrates multiple clients (devices) joining the same HALO. Demo video.

The Space Invitation Story demonstrates multiple clients creating and sharing spaces. Demo video.

DXOS Resources

Contributions

Your ideas, issues, and code are most welcome. Please take a look at our community code of conduct, the issue guide, and the PR contribution guide.

License: MIT Copyright 2022 © DXOS

Dependencies (13)

Dev Dependencies (12)

Package Sidebar

Install

npm i @dxos/react-client

Homepage

dxos.org

Weekly Downloads

5,707

Version

0.4.9

License

MIT

Unpacked Size

307 kB

Total Files

172

Last publish

Collaborators

  • zhenya-dxos
  • mykola-vrmchk
  • dxos-bot
  • richburdon
  • marik_d
  • wittjosiah