Skip to content

Commit 61f672f

Browse files
authored
More accurate typescript typings
According to the API, all but the `src` prop are optional, but the `Props` interface had no optional properties, making anyone who uses typescript **have** to pass everything (or it would throw a type error and will not compile). I updated the interface to make the denote the non-required props as optional :)
1 parent 3cd2277 commit 61f672f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export type OnInjected = (
1010
) => void
1111

1212
interface Props {
13-
evalScripts: 'always' | 'once' | 'never'
14-
fallback: React.ReactType
15-
loading: React.ReactType
16-
onInjected: OnInjected
17-
renumerateIRIElements: boolean
13+
evalScripts?: 'always' | 'once' | 'never'
14+
fallback?: React.ReactType
15+
loading?: React.ReactType
16+
onInjected?: OnInjected
17+
renumerateIRIElements?: boolean
1818
src: string
19-
svgClassName: string
20-
svgStyle: React.CSSProperties
19+
svgClassName?: string
20+
svgStyle?: React.CSSProperties
2121
}
2222

2323
interface State {

0 commit comments

Comments
 (0)