https://github.com/jharrilim/use-rss
React hook for RSS feeds
https://github.com/jharrilim/use-rss
hook react rss
Last synced: 5 months ago
JSON representation
React hook for RSS feeds
- Host: GitHub
- URL: https://github.com/jharrilim/use-rss
- Owner: jharrilim
- License: mit
- Created: 2020-05-08T02:18:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T05:18:02.000Z (over 2 years ago)
- Last Synced: 2025-02-02T08:46:35.214Z (5 months ago)
- Topics: hook, react, rss
- Language: TypeScript
- Homepage: https://npmjs.org/@jharrilim/use-rss
- Size: 1.24 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# useRss Hook


React hook for RSS feeds.
## Install
```sh
npm i @jharrilim/use-rss
```## Usage
[](https://codesandbox.io/s/use-rss-demo-2eqdg?fontsize=14&hidenavigation=1&theme=dark)
```tsx
import React from 'react';
import useRss from '@jharrilim/use-rss';export const MyApp = () => {
const redditFeed = useRss('https://reddit.com/.rss');
if (redditFeed === null)
returnLoading...
;
return (
{redditFeed?.title}
{redditFeed?.description}
{redditFeed?.items.map((item, i) => (
{item?.title}
{item?.creator} - {item?.pubDate}
{item?.content}
))}
);
}
```