If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).
Example below explains implications for different implementations.
| // there's a sandbox to try this out on the react-dropzone website: | |
| // https://react-dropzone.js.org/ | |
| import React from 'react'; | |
| import {useDropzone} from 'react-dropzone'; | |
| function Basic(props) { | |
| const {acceptedFiles, getRootProps, getInputProps} = useDropzone(); | |
| const files = acceptedFiles.map(file => ( |
| <?php | |
| use PhpCsFixer\Config; | |
| use PhpCsFixer\Finder; | |
| $rules = [ | |
| 'array_indentation' => true, | |
| 'array_syntax' => ['syntax' => 'short'], | |
| 'binary_operator_spaces' => [ | |
| 'default' => 'single_space', |