Commit f3ca38f
authored
Export props-type for external consumption
This patch exports `SimpleMDEEditorProps` so that it can be used outside of the module. It also changes it to an interface instead of a type so that it can be `extends`-ed or `implements`-ed by others.
My use case is to have a small wrapper module which customizes the toolbar for my project. I then want to be able to accept all the original properties, and my own. Something like this:
```typescript
import SimpleMDE, { SimpleMDEEditorProps } from 'react-simplemde-editor'
interface MarkdownEditorProps extends SimpleMDEEditorProps {
foobar: string
}
const MarkdownEditor: React.FunctionComponent<MarkdownEditorProps> = ({ foobar, ...props }) => {
// do something with foobar
return <SimpleMDE {...props} />
}
```1 parent a971007 commit f3ca38f
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments