Skip to content

Commit

Permalink
fix TS error
Browse files Browse the repository at this point in the history
  • Loading branch information
schickling committed May 31, 2023
1 parent 2ec1039 commit b87a187
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/next-contentlayer/src/hooks/useMDXComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ type MDXContentProps = {
components?: MDXComponents
}

export const getMDXComponent = (
code: string,
globals: Record<string, unknown> = {},
): React.ComponentType<MDXContentProps> => {
export const getMDXComponent = (code: string, globals: Record<string, unknown> = {}): React.FC<MDXContentProps> => {
const scope = { React, ReactDOM, _jsx_runtime, ...globals }
const fn = new Function(...Object.keys(scope), code)
return fn(...Object.values(scope)).default
Expand Down

0 comments on commit b87a187

Please sign in to comment.