Port Triggers node to react. Fixes #6672

This commit is contained in:
Nikhil Mohite
2021-09-09 13:03:54 +05:30
committed by Akshay Joshi
parent bb5e2b98e9
commit 351cb3e6ca
9 changed files with 908 additions and 9 deletions
@@ -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,