Skip to content

Commit f3ca38f

Browse files
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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type SimpleMdeToCodemirror = {
2525
[E in CodemirrorEvents | DOMEvent]: Editor["on"]
2626
};
2727

28-
type SimpleMDEEditorProps = {
28+
export interface SimpleMDEEditorProps {
2929
id?: string;
3030
label?: string;
3131
onChange: (value: string) => void | any;

0 commit comments

Comments
 (0)