pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
21.58k stars 1.06k forks source link

Question about usage with React.js #6303

Closed xzecakular closed 2 months ago

xzecakular commented 3 months ago

Hi everyone,

What is the recommended approach for using RxDB with React.js? For example, how can one effectively use CRUD methods of RxCollection or RxDocument in a React app? I know about rxdb-hooks package that provides sort of a bridge between RxJS and React. This package is even mentioned in one of the articles, but it seems unmaintained lately - the last commit was on Mar 17, 2023, more than 16 months ago at the time of writing. Also, as I understand it, it is not one of the official RxDB packages, correct?

Another thing that caught my eye is Custom reactivity, mentioned here and here. Can this feature help with "integrating" RxDB with React?

Many thanks for your replies.

pubkey commented 3 months ago

Yes it is not an official package. Yes, the custom reactivity enables you to use react hooks or preact signals to get non-rxjs stuff out of RxDB if you do not need observables.

xzecakular commented 3 months ago

Could you elaborate on how to set up custom reactivity for hooks?

pubkey commented 3 months ago

No I think the docs explain it pretty good. If something is missing please read the code.