Add small issue with callback
This commit is contained in:
@@ -6,14 +6,14 @@ const IdeEditor = () => {
|
|||||||
const { state, dispatch } = useContext(IdeContext)
|
const { state, dispatch } = useContext(IdeContext)
|
||||||
|
|
||||||
function handleCodeChange(value, _event) {
|
function handleCodeChange(value, _event) {
|
||||||
dispatch({ type: 'updateCode', payload: target.value })
|
dispatch({ type: 'updateCode', payload: value })
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Editor
|
<Editor
|
||||||
defaultValue={ state.code }
|
defaultValue={state.code}
|
||||||
defaultLanguage='javascript'
|
defaultLanguage="javascript"
|
||||||
onChange={ handleCodeChange }
|
onChange={handleCodeChange}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user