import * as React from 'react' ; import type { GatsbySSR , GatsbyBrowser } from 'gatsby' ; import { PrismicPreviewProvider } from 'gatsby-plugin-prismic-previews' ; import { linkResolver } from './src/linkResolver' ; import { componentResolver } from './src/componentResolver' ; type WrapRootElement = ( GatsbySSR | GatsbyBrowser ) [ 'wrapRootElement' ] ; const defaultRepositoryConfigs = [ { repositoryName : 'karrot' , linkResolver , componentResolver , } , ] ; export const wrapRootElement = ( { element } ) => { return ( < PrismicPreviewProvider repositoryConfigs = { defaultRepositoryConfigs } > { element } < /PrismicPreviewProvider>); } ;