File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ function YourMainContent({ themeColor }: { themeColor: string }) {
6262 handler : ( { proverb } ) => {
6363 setState ( {
6464 ...state ,
65- proverbs : [ ...state . proverbs , proverb ] ,
65+ proverbs : [ ...( state . proverbs || [ ] ) , proverb ] ,
6666 } ) ;
6767 } ,
6868 } ) ;
@@ -99,7 +99,7 @@ function YourMainContent({ themeColor }: { themeColor: string }) {
9999 < button
100100 onClick = { ( ) => setState ( {
101101 ...state ,
102- proverbs : state . proverbs ? .filter ( ( _ , i ) => i !== index ) ,
102+ proverbs : ( state . proverbs || [ ] ) . filter ( ( _ , i ) => i !== index ) ,
103103 } ) }
104104 className = "absolute right-3 top-3 opacity-0 group-hover:opacity-100 transition-opacity
105105 bg-red-500 hover:bg-red-600 text-white rounded-full h-6 w-6 flex items-center justify-center"
You can’t perform that action at this time.
0 commit comments