Set Default Value Of Property Of Object Passed On Parameter To Function
The key difference on this question is I want to keep my property referenced inside the object, not destructured. export interface MapSettings { up: 'trueNorth' | 'runIn' | 'magn
Solution 1:
just check it and set it:
exportconstMap: FunctionComponent<MapProps> = functionMap({
settings,
}) {
settings.rotation = (settings.rotation || settings.roation === 0) ? settings.rotation : 360
Post a Comment for "Set Default Value Of Property Of Object Passed On Parameter To Function"