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

0.14.23 • Public • Published

Shows the Instant logo

@instantdb/react

stars

Get Started · Examples · Try the Demo · Docs · Discord

Welcome to Instant's React SDK.

// ༼ つ ◕_◕ ༽つ Real-time Chat
// ----------------------------------
// * Updates instantly
// * Multiplayer
// * Works offline
function Chat() {
  // 1. Read
  const { isLoading, error, data } = useQuery({
    messages: {},
  });

  // 2. Write
  const addMessage = (message) => {
    transact(tx.messages[id()].update(message));
  }

  // 3. Render!
  return <UI data={data} onAdd={addMessage} />
}

Get Started

Follow the getting started tutorial to set up a live React app in under 5 minutes! Or you can try an interactive demo in your browser :).

Questions?

If you have any questions, feel free to drop us a line on our Discord

Readme

Keywords

none

Package Sidebar

Install

npm i @instantdb/react

Weekly Downloads

2,295

Version

0.14.23

License

none

Unpacked Size

428 kB

Total Files

72

Last publish

Collaborators

  • reichertjalex
  • dww
  • markyfyi
  • nezaj
  • stopachka