react-native-code-editor icon indicating copy to clipboard operation
react-native-code-editor copied to clipboard

The editor clears the code to initial value upon edit

Open HarunKaranja opened this issue 3 years ago • 0 comments

https://user-images.githubusercontent.com/98604306/178748289-369c9d25-24f3-4bda-8f80-7a37fb1af863.mp4

The code

const [editorCode, setEditorCode] = useState('')


<CodeEditor
       style={Styles.codeEditorStyles}
       language={ language }
       syntaxStyle={CodeEditorSyntaxStyles.atomOneDark}
       showLineNumbers
       onChange={ value => setEditorCode(value) }
       initialValue={ exampleCode }
 />

when i remove onChange={ value => setEditorCode(value) } , there's no issue but i need to get the value

How do i solve that

HarunKaranja avatar Jul 13 '22 13:07 HarunKaranja