I have this function, for example:
const FieldRange = props => (
<div className={b('field-range', props)}>
{props.children}
{!!props.errorFieldName && <Field name={props.errorFieldName}/>}
</div>
);
Eventually I decide that I want it to be more dry, and rewrite it like that, restructuring argument object into properties:
const FieldRange = ({ children, errorFieldName }) => (
<div className={b('field-range', props)}>
{children}
{!!errorFieldName && <Field name={errorFieldName}/>}
</div>
);
But, oh no, I still need the original object on the second line! Is there a way to destructure an object, but still leave it available in the function body?