@@ -28,12 +28,17 @@ const story: Meta<typeof ComposerWithNavigation> = {
28
28
29
29
const parser = new ExpensiMark ( ) ;
30
30
31
+ const DEFAULT_VALUE = `Composer can do the following:
32
+
33
+ * It can contain MD e.g. *bold* _italic_
34
+ * Supports Pasted Images via Ctrl+V` ;
35
+
31
36
function Default ( props : ComposerProps ) {
32
37
const StyleUtils = useStyleUtils ( ) ;
33
38
const [ pastedFile , setPastedFile ] = useState < FileObject | null > ( null ) ;
34
- const [ comment , setComment ] = useState ( props . defaultValue ) ;
39
+ const [ comment , setComment ] = useState ( DEFAULT_VALUE ) ;
35
40
const renderedHTML = parser . replace ( comment ?? '' ) ;
36
- const [ selection , setSelection ] = useState < TextSelection > ( ( ) => ( { start : props . defaultValue ?. length ?? 0 , end : props . defaultValue ?. length ?? 0 , positionX : 0 , positionY : 0 } ) ) ;
41
+ const [ selection , setSelection ] = useState < TextSelection > ( ( ) => ( { start : DEFAULT_VALUE . length , end : DEFAULT_VALUE . length , positionX : 0 , positionY : 0 } ) ) ;
37
42
38
43
return (
39
44
< View >
@@ -79,10 +84,6 @@ Default.args = {
79
84
autoFocus : true ,
80
85
placeholder : 'Compose Text Here' ,
81
86
placeholderTextColor : defaultTheme . placeholderText ,
82
- defaultValue : `Composer can do the following:
83
-
84
- * It can contain MD e.g. *bold* _italic_
85
- * Supports Pasted Images via Ctrl+V` ,
86
87
isDisabled : false ,
87
88
maxLines : 16 ,
88
89
} ;
0 commit comments