I have a context like this, In each page I have to update certain fields in the interface from their initial values, how can I change each values in that interface
Assignment operator shows error :- The left-hand side of an assignment expression may not be an optional property access.ts(2779)
import * as React from "react";
interface OrderContextInterface {
outboundQuoteId: string;
senderId: string;
receiverId: string;
routeId: number;
paymentOptionId: number;
purposeOfTransaction: string
}
export const OrderContext = React.createContext<OrderContextInterface | null>(null);
export const initialOrder: OrderContextInterface = {
outboundQuoteId: '',
senderId: '',
receiverId: '',
routeId: 0,
paymentOptionId: 0,
purposeOfTransaction: '',
};
//In Other Screens
useEffect(() => {
order?.outboundQuoteId="ada"; **//error**
}, []);
//contexts
const order = useContext(OrderContext);