Mahdi Naser Moghadasi commited on
Commit ·
8286756
1
Parent(s): 51fee5f
Add key prop to Monaco Editor to force re-render when code changes
Browse files- Added key prop based on code content to ensure editor updates
- This should fix the issue where code doesn't display on desktop
- Editor will now properly show starter code when question is selected
165 unmodified lines166167168169170171165 unmodified lines</div>) : (<MonacoEditorheight={editorHeight.toString()}defaultLanguage="python"value={code || ''}165 unmodified lines166167168169170171172165 unmodified lines</div>) : (<MonacoEditorkey={`desktop-${code?.substring(0, 20) || 'empty'}`}height={editorHeight.toString()}defaultLanguage="python"value={code || ''}
components/CodeEditor.tsx+1