Closed bala-pitchuka closed 4 months ago
please find the snippet
import { DecisionGraph, JdmConfigProvider } from '@gorules/jdm-editor'; import '@gorules/jdm-editor/dist/style.css';
function App() { return ( <div className="App"> <JdmConfigProvider> <DecisionGraph onChange={(val) => setGraph(val)} /> </JdmConfigProvider> </div> ); } export default App;
Error
Failed to compile.
[eslint] src/App.js Line 11:30: 'setGraph' is not defined no-undef
Search for the keywords to learn more about each error. ERROR in [eslint] src/App.js Line 11:30: 'setGraph' is not defined no-undef
Search for the keywords to learn more about each error.
webpack compiled with 1 error
Hi, this looks like and issue on your side with linter when using components - you will need to set a state you are missing const [graph, setGraph] = useState()
please find the snippet
import { DecisionGraph, JdmConfigProvider } from '@gorules/jdm-editor'; import '@gorules/jdm-editor/dist/style.css';
Error
Failed to compile.
[eslint] src/App.js Line 11:30: 'setGraph' is not defined no-undef
Search for the keywords to learn more about each error. ERROR in [eslint] src/App.js Line 11:30: 'setGraph' is not defined no-undef
Search for the keywords to learn more about each error.
webpack compiled with 1 error