Skip to content

Commit

Permalink
fix: improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
elribonazo committed Jan 1, 2025
1 parent 5aeb96f commit f8e9272
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/ridb-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npm i @trust0/ridb-react
## Usage
```typescript
import React from 'react'
import { Database, useDatabase } from '@trust0/ridb-react'
import { Database, useDatabase, DatabaseProvider } from '@trust0/ridb-react'
```

Create your schemas and type them for better inference.
Expand Down Expand Up @@ -76,4 +76,12 @@ const MyComponent: React.FC = () => {
};
```

Wrap your component with the `DatabaseProvider` component to provide the database instance to your component.

```typescript
<DatabaseProvider>
<MyComponent />
</DatabaseProvider>
```

All the database methods and operations from RIDB are supported, for more details check the [RIDB documentation](https://github.com/trust0-project/RIDB/packages/ridb/README.md)
1 change: 1 addition & 0 deletions packages/ridb-react/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@trust0/ridb-react",
"description": "React bindings for RIDB, use RIDB on React seemlessly",
"version": "0.0.1",
"author": "elribonazo@gmail.com",
"repository": {
Expand Down

0 comments on commit f8e9272

Please sign in to comment.