@@ -6,8 +6,8 @@ import { Ionicons } from '@expo/vector-icons';
66import * as Clipboard from 'expo-clipboard' ;
77import * as Crypto from 'expo-crypto' ;
88import { useLocalSearchParams , useRouter } from 'expo-router' ;
9- import { CheckSquare , Code , Copy , FileText , Heading1 , Heading2 , Heading3 , Lightbulb , List , ListOrdered , Minus , Plus , Quote , Redo2 , Save , Type , Undo2 , X } from 'lucide-react-native' ;
10- import React , { useCallback , useEffect , useRef , useState } from 'react' ;
9+ import { CheckSquare , Code , Copy , Heading1 , Heading2 , Heading3 , Lightbulb , List , ListOrdered , Minus , Plus , Quote , Redo2 , Save , Type , Undo2 , X } from 'lucide-react-native' ;
10+ import React , { StrictMode , useCallback , useEffect , useRef , useState } from 'react' ;
1111import { ActivityIndicator , Alert , Animated , FlatList , Modal , StatusBar , StyleSheet , Text , TextInput , TouchableOpacity , View } from 'react-native' ;
1212import { SafeAreaView } from 'react-native-safe-area-context' ;
1313import MarkdownEditor from '../components/editor/MarkdownEditor' ;
@@ -279,7 +279,7 @@ export default function EditorScreen() {
279279 }
280280 hideBlockComponents ( ) ;
281281 } , [ hideBlockComponents ] ) ;
282-
282+
283283 // Handle block changes
284284 const handleBlockChange = useCallback ( ( blocks : EditorBlock [ ] ) => {
285285 setBlocks ( blocks ) ;
@@ -405,22 +405,22 @@ export default function EditorScreen() {
405405 await Clipboard . setStringAsync ( isEditingMarkdown ? editedMarkdown : rawMarkdown ) ;
406406 Alert . alert ( 'Copied!' , 'Markdown copied to clipboard' ) ;
407407 } , [ rawMarkdown , editedMarkdown , isEditingMarkdown ] ) ;
408-
408+
409409 // Apply edited markdown
410410 const handleApplyMarkdown = useCallback ( ( ) => {
411411 if ( editorRef . current && editedMarkdown !== rawMarkdown ) {
412412 try {
413413 // Apply the markdown to the editor
414414 editorRef . current . setMarkdown ( editedMarkdown ) ;
415-
415+
416416 // Get the updated blocks from the editor after parsing
417417 setTimeout ( ( ) => {
418418 if ( editorRef . current ) {
419419 const updatedBlocks = editorRef . current . getBlocks ( ) ;
420420 setBlocks ( updatedBlocks ) ;
421421 }
422422 } , 100 ) ;
423-
423+
424424 setRawMarkdown ( editedMarkdown ) ;
425425 setIsEditingMarkdown ( false ) ;
426426 markAsChanged ( ) ;
@@ -433,13 +433,13 @@ export default function EditorScreen() {
433433 setIsEditingMarkdown ( false ) ;
434434 }
435435 } , [ editedMarkdown , rawMarkdown , markAsChanged ] ) ;
436-
436+
437437 // Start editing markdown
438438 const handleEditMarkdown = useCallback ( ( ) => {
439439 setEditedMarkdown ( rawMarkdown ) ;
440440 setIsEditingMarkdown ( true ) ;
441441 } , [ rawMarkdown ] ) ;
442-
442+
443443 // Cancel editing markdown
444444 const handleCancelEditMarkdown = useCallback ( ( ) => {
445445 setEditedMarkdown ( rawMarkdown ) ;
@@ -544,25 +544,27 @@ export default function EditorScreen() {
544544 </ View >
545545 ) : (
546546 < View style = { styles . editorContainer } >
547- < MarkdownEditor
548- ref = { editorRef }
549- initialBlocks = { blocks }
550- placeholder = "Start writing..."
551- onBlocksChange = { handleBlockChange }
552- theme = { getEditorTheme ( colorScheme || 'light' ) }
553- config = { {
554- toolbar : { enabled : false } ,
555- theme : {
556- colors : {
557- background : colors . background ,
558- text : colors . text ,
559- border : colorScheme === 'dark' ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)' ,
560- primary : colors . tint ,
561- secondary : colors . icon
547+ < StrictMode >
548+ < MarkdownEditor
549+ ref = { editorRef }
550+ initialBlocks = { blocks }
551+ placeholder = "Start writing..."
552+ onBlocksChange = { handleBlockChange }
553+ theme = { getEditorTheme ( colorScheme || 'light' ) }
554+ config = { {
555+ toolbar : { enabled : false } ,
556+ theme : {
557+ colors : {
558+ background : colors . background ,
559+ text : colors . text ,
560+ border : colorScheme === 'dark' ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)' ,
561+ primary : colors . tint ,
562+ secondary : colors . icon
563+ }
562564 }
563- }
564- } }
565- / >
565+ } }
566+ />
567+ </ StrictMode >
566568 </ View >
567569 ) }
568570
@@ -728,7 +730,7 @@ export default function EditorScreen() {
728730 < X size = { 24 } color = { colors . text } />
729731 </ TouchableOpacity >
730732 </ View >
731-
733+
732734 { isEditingMarkdown ? (
733735 < TextInput
734736 style = { [ styles . markdownInput , {
@@ -752,7 +754,7 @@ export default function EditorScreen() {
752754 < Text style = { [ styles . markdownText , { color : colors . text } ] } > { rawMarkdown } </ Text >
753755 </ View >
754756 ) }
755-
757+
756758 < View style = { styles . markdownModalActions } >
757759 { isEditingMarkdown ? (
758760 < >
0 commit comments