[0.8.3] Feature/Custom components into shift-next config#38
[0.8.3] Feature/Custom components into shift-next config#38jameskirkby merged 3 commits intomasterfrom
Conversation
| */ | ||
| export default function renderComponents (pageComponents) { | ||
| // Merge any custom template components with the ones from shift-react-components | ||
| const templateComponentsManifest = Object.assign({}, buildTemplateComponentsManifest(), Config.get().customTemplateComponents) |
There was a problem hiding this comment.
With this change in place shift-react-components can now export the templateComponentManifest directly instead of exporting buildTemplateComponentsManifest . The reason the manifest was exported as a function was so that the call to config would happen at runtime.
There was a problem hiding this comment.
I'll make a ticket for this
hubertpompecki
left a comment
There was a problem hiding this comment.
Nothing against this change in principle but I am surprised that it's needed in the first place. I thought we recently looked at adding template components and verified that it worked OK?
|
@hubertpompecki it worked, then it stopped working for a reason I couldn't figure out. A couple of us looked into it and got nowhere Feels a bit long to do this too: When instead, this PR does this: |
This PR allows custom components to be passed to
shift-nextthrough theshiftNextConfig.set()function, for example:This means that the components don't need to go through
shift-react-components, as this was causing issues where the custom components weren't showing in theshift-react-componentsConfig, which meant that custom components weren't showing on the pageAlso, small refactor to the
renderComponents()function inshift-nextto use a.map()instead of a forloopAdded some basic documentation too