We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad0bdd6 commit 89399a8Copy full SHA for 89399a8
src/client.ts
@@ -1,14 +1,18 @@
1
import * as React from 'react'
2
3
+interface ComponentMap {
4
+ [name: string]: React.ComponentType | string | ComponentMap
5
+}
6
+
7
+interface MDXContentProps {
8
+ [props: string]: unknown
9
+ components?: ComponentMap
10
11
12
function getMDXComponent(
13
code: string,
14
globals?: Record<string, unknown>,
-): React.FunctionComponent<{
- components?: Record<
- string,
- React.FunctionComponent | React.Component | string
- >
-}> {
15
+): React.FunctionComponent<MDXContentProps> {
16
const scope = {React, ...globals}
17
// eslint-disable-next-line
18
const fn = new Function(...Object.keys(scope), code)
0 commit comments