Tutorial

Migration from @quintype/framework v3.x.x to v4.x.x

Version v4.x.x of @quintype/framework, which comes bundled with v2.x.x of @quintype/amp contains a breaking change to the amp library API.

All the render props used to customize the default templates are now grouped under the render key inside the opts object.

Before

ampRoutes(app, {
  seo: generateAmpSeo,
  relatedStoriesRender: ({ relatedStories, config }) => <Alsoread stories={relatedStories} config={config} />,
  headerCardRender: ({ story, config }) => <Headercard story={story} config={config} />,
  infiniteScrollRender: ({ story, config, inlineConfig }) => (
    <AmpInfiniteScroll story={story} config={config} inlineConfig={inlineConfig} />
  ),
  storyElementRender: storyElementOverrides
});

After

ampRoutes(app, {
  seo: generateAmpSeo,
  render: {
    relatedStoriesRender: ({ relatedStories, config }) => <Alsoread stories={relatedStories} config={config} />,
    headerCardRender: ({ story, config }) => <Headercard story={story} config={config} />,
    infiniteScrollRender: ({ story, config, inlineConfig }) => (
      <AmpInfiniteScroll story={story} config={config} inlineConfig={inlineConfig} />
    ),
    storyElementRender: storyElementOverrides
  }
});