fix: Dedupe layout selection logic

This commit is contained in:
Bouncey
2019-02-28 15:44:35 +00:00
committed by mrugesh
parent 7a88eadf7d
commit 15f18d1cda
3 changed files with 52 additions and 37 deletions

View File

@ -5,9 +5,8 @@ import { Provider } from 'react-redux';
import headComponents from './src/head';
import { createStore } from './src/redux/createStore';
import { wrapPageElement } from './gatsby-browser';
export { wrapPageElement };
import layoutSelector from './utils/gatsby/layoutSelector';
const store = createStore();
@ -19,6 +18,8 @@ wrapRootElement.propTypes = {
element: PropTypes.any
};
export const wrapPageElement = layoutSelector;
export const onRenderBody = ({ setHeadComponents, setPostBodyComponents }) => {
setHeadComponents([...headComponents]);
setPostBodyComponents(