Skip to content

Commit

Permalink
fixes Script function child check in document
Browse files Browse the repository at this point in the history
  • Loading branch information
housseindjirdeh committed May 17, 2022
1 parent 4a86a8f commit 9813e11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export class Head extends Component<
const filteredChildren: ReactNode[] = []

React.Children.forEach(children, (child: any) => {
if (child.type === Script) {
if (typeof child.type === 'function' && child.type.name === 'Script') {
if (child.props.strategy === 'beforeInteractive') {
scriptLoader.beforeInteractive = (
scriptLoader.beforeInteractive || []
Expand Down

0 comments on commit 9813e11

Please sign in to comment.