Adding initial shot at handling build issues

This commit is contained in:
Jeff Avallone 2019-01-11 23:07:17 -05:00
parent a4450b34b3
commit 9a4f669c2d

View File

@ -76,11 +76,13 @@ const createPngLink = async ({ svg, width, height }) => {
}; };
class App extends React.PureComponent { class App extends React.PureComponent {
state={ state={}
...readURLHash()
}
componentDidMount() { componentDidMount() {
// Gatsby doesn't have document.location, so readURLHash can't be called
// until here
this.setState(readURLHash());
window.addEventListener('hashchange', this.handleHashChange); window.addEventListener('hashchange', this.handleHashChange);
this.handleHashChange(); this.handleHashChange();
} }
@ -144,7 +146,7 @@ class App extends React.PureComponent {
}; };
return <AppContext.Provider value={ context }> return <AppContext.Provider value={ context }>
<Form /> { syntax && <Form /> }
<Loader /> <Loader />