react-orbit
v0.0.1
Published
React bindings for Orbit.js
Downloads
19
Maintainers
Readme
react-orbit-hooks
React bindings for orbit.js
USAGE
import React, { useEffect } from 'react';
import { useQuery } from 'react-orbit';
export default ArticlesList() {
const {data: articles = [], query} = useQuery();
useEffect(() => {
query(t => t.findRecords('article'));
}, []);
return (
{articles.map((article) => (
<>
<h1>{article.attributes.title}</h1>
<p>{article.attributes.body}</p>
</>
))}
);
}