Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
themeEmacs
// react 예제 (unmount 시 destroy 호출)

useEffect(() => {
	```
	const config = {};
	const html = '';
	const eventListener = {};
	
	editor = new SynapEditor('synapeditor', config, html, eventListener);
	```
	return () => {
		if (editor) {
			```
			editor.destroy();
			editor = null;
			```
		}
	}
}, []);

...