DPDK Architecture  ->  Library (v3.4.4)

Data management

The Prismic CMS has many options to define data, but is much simpler than what we had before. Through the hydrate you have many ways of using this data in different places.

getInitialProps

Pages and slices can both use the .getInitialProps function which is also provided with Next context.

Home.getInitialProps = async ({ context }) => {
  return { locale: context.locale };
}

If a slice is in the object (so dynamic from the CMS), .getInitialProps is also provided with slice data.

Slice.getInitialProps = async ({ context, sliceData }) => {
  // Do anything with the context or sliceData
  return { ... };
}
Last modifiedMonday, August 30, 2021, 2:00:02 PM UTC
Last authorColin van Eenige
Commit IDfd08685