Skip to content

Commit f3f376d

Browse files
committed
Fix react typescript 00 sample
1 parent 3b3ec1a commit f3f376d

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

samples/react/typescript/00 SimpleForm/src/reducers/customer.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,11 @@ function customerProcessUIInputCompleted(state: CustomerState, action: ICustomer
4848
}
4949

5050
function customerSaveCompleted(state: CustomerState, action: ICustomerSaveCompletedAction): CustomerState {
51-
const newCustomerErrors: CustomerErrors = Object.assign({}, state.customerErrors);
52-
53-
action.formValidationResult.fieldErrors.forEach(fieldValidationResult => {
54-
newCustomerErrors[fieldValidationResult.key] = fieldValidationResult;
55-
});
56-
5751
return {
5852
...state,
59-
customerErrors: newCustomerErrors
53+
customerErrors: {
54+
...state.customerErrors,
55+
...action.formValidationResult.fieldErrors,
56+
}
6057
};
6158
}

samples/react/typescript/00 SimpleForm/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"experimentalDecorators": true,
1111
"emitDecoratorMetadata": true,
1212
"preserveConstEnums": true,
13-
"suppressImplicitAnyIndexErrors": true
13+
"suppressImplicitAnyIndexErrors": true,
14+
"skipLibCheck": true
1415
},
1516
"compileOnSave": false,
1617
"exclude": [

0 commit comments

Comments
 (0)