File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -86,9 +86,9 @@ import "easymde/dist/easymde.min.css";
86
86
export const ControlledUsage = () => {
87
87
const [value, setValue] = useState (" Initial value" );
88
88
89
- const onChange = (value : string ) => {
89
+ const onChange = useCallback ( (value : string ) => {
90
90
setValue (value );
91
- };
91
+ }, []) ;
92
92
93
93
return <SimpleMdeReact value = { value } onChange = { onChange } />;
94
94
};
@@ -112,9 +112,9 @@ Slightly more on that here: [#164](https://github.com/RIP21/react-simplemde-edit
112
112
export const UsingOptions = () => {
113
113
const [value, setValue] = useState (" Initial" );
114
114
115
- const onChange = (value : string ) => {
115
+ const onChange = useCallback ( (value : string ) => {
116
116
setValue (value );
117
- };
117
+ }, []) ;
118
118
119
119
const autofocusNoSpellcheckerOptions = useMemo (() => {
120
120
return {
@@ -202,9 +202,9 @@ import type { SimpleMdeToCodemirrorEvents } from "react-simplemde-editor";
202
202
export const CustomEventListeners = () => {
203
203
const [value, setValue] = useState (" Initial value" );
204
204
205
- const onChange = (value : string ) => {
205
+ const onChange = useCallback ( (value : string ) => {
206
206
setValue (value );
207
- };
207
+ }, []) ;
208
208
209
209
// Make sure to always `useMemo` all the `options` and `events` props to ensure best performance!
210
210
const events = useMemo (() => {
You can’t perform that action at this time.
0 commit comments