monaco-react icon indicating copy to clipboard operation
monaco-react copied to clipboard

callback inside onMount function is caching?

Open Angryman18 opened this issue 3 years ago • 0 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Or, please add a minimal code snippet to reproduce the issue, for example in codesandbox.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help to explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context writtenCode changes whenever user edits on editor. but hitting ctrl + enter i want to run the (executeCode makes that api call) but i see everytime code changes and hitting ctrl + enter this callback function is taking the old code like what code was when the editor got mount. why is this? how to fix this issue. hitting ctrl + enter i want latest code run everytime

handleEditorMount the called on onMount

Screenshot from 2022-10-08 09-37-06

Angryman18 avatar Oct 08 '22 04:10 Angryman18