Skip to content

Instantly share code, notes, and snippets.

@mattecapu
Last active January 11, 2017 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattecapu/4fc26bc347534d3c3697899a23e8e87c to your computer and use it in GitHub Desktop.
Save mattecapu/4fc26bc347534d3c3697899a23e8e87c to your computer and use it in GitHub Desktop.
import Library from '../components/library';
export default class App extends React.Component {
static async getInitialProps() {
return await Lokka.query(`{
libraries {
id,
...${Library.getFragment()}
}
}`);
}
render() {
const libraries =
this.props.libraries.map(({ id, ...library }) =>
<Library library={library} key={id} />
);
return (
<main>
<h1>{`libradar`}</h1>
<section>
<ul className="libraries-list">
{libraries}
</ul>
</section>
</main>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment