Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 1.06 KB

README.md

File metadata and controls

53 lines (41 loc) · 1.06 KB

react-wp-gql

WordPress Rendering and Routing for WP-GraphQL.

GitHub GitHub last commit

Install

yarn add https://github.com/jonshipman/react-wp-gql

Usage

// React
import React from "react";
import { Switch, Route } from "react-router-dom";
import { WordPressRoutes, NodeProvider } from "react-boilerplate-nodes";
import { FormGroup } from "react-boilerplate-leadform";
import { Header, Footer, Main } from "./layout";
import { Home } from "./home";
import * as queries from "./gql/queries";
import "./app.scss";

const nodeProps = {
  queries,
  components: {
    FormGroup,
  },
};

export const App = () => (
  <NodeProvider {...nodeProps}>
    <Header />
    <Main>
      <Switch>
        <Route exact path="/">
          <Home />
        </Route>

        <WordPressRoutes />
      </Switch>
    </Main>
    <Footer />
  </NodeProvider>
);

License

Apache 2.0 © jonshipman