rsnext/packages/next/shared/lib/head-manager-context.ts
Janicklas Ralph fd1c56e66a
next/script fix duplicate scripts (#28428)
* Fix #27747

* Fix lint error

* Add data attribute to script component

* Fix #28036

* Fix tests

* Fix tests

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-08-24 11:07:38 -05:00

13 lines
352 B
TypeScript

import React from 'react'
export const HeadManagerContext: React.Context<{
updateHead?: (state: any) => void
mountedInstances?: any
updateScripts?: (state: any) => void
scripts?: any
getIsSsr?: () => boolean
}> = React.createContext({})
if (process.env.NODE_ENV !== 'production') {
HeadManagerContext.displayName = 'HeadManagerContext'
}