mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-11 13:34:50 -05:00
Port Triggers node to react. Fixes #6672
This commit is contained in:
committed by
Akshay Joshi
parent
bb5e2b98e9
commit
351cb3e6ca
@@ -13,7 +13,7 @@ import {useOnScreen} from 'sources/custom_hooks';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/* React wrapper for CodeMirror */
|
||||
export default function CodeMirror({name, value, options, events, ...props}) {
|
||||
export default function CodeMirror({currObj, name, value, options, events, ...props}) {
|
||||
const taRef = useRef();
|
||||
const cmObj = useRef();
|
||||
const cmWrapper = useRef();
|
||||
@@ -24,6 +24,8 @@ export default function CodeMirror({name, value, options, events, ...props}) {
|
||||
cmObj.current = new OrigCodeMirror.fromTextArea(
|
||||
taRef.current, options);
|
||||
|
||||
currObj && currObj(cmObj.current);
|
||||
|
||||
if(cmObj.current) {
|
||||
try {
|
||||
cmWrapper.current = cmObj.current.getWrapperElement();
|
||||
@@ -65,6 +67,7 @@ export default function CodeMirror({name, value, options, events, ...props}) {
|
||||
}
|
||||
|
||||
CodeMirror.propTypes = {
|
||||
currObj: PropTypes.func,
|
||||
name: PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
options: PropTypes.object,
|
||||
|
||||
Reference in New Issue
Block a user