mirror of
https://github.com/t4t5/nostr-react.git
synced 2025-03-17 13:31:43 +01:00
Add import to README example
This commit is contained in:
parent
7018f939e9
commit
6fd4c777aa
@ -37,12 +37,13 @@ You can now use the `useNostr` and `useNostrEvents` hooks in your components!
|
||||
**Fetching all `text_note` events starting now:**
|
||||
|
||||
```tsx
|
||||
import { useRef } from "react";
|
||||
import { useNostrEvents, dateToUnix } from "nostr-react";
|
||||
|
||||
const GlobalFeed = () => {
|
||||
const now = useRef(new Date()); // Make sure current time isn't re-rendered
|
||||
|
||||
const { isLoading, connectedRelays, events } = useNostrEvents({
|
||||
const { events } = useNostrEvents({
|
||||
filter: {
|
||||
since: dateToUnix(now.current), // all new events from now
|
||||
kinds: [1],
|
||||
|
Loading…
x
Reference in New Issue
Block a user