Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. // To avoid such constructions:
  2. const props = {
  3. name: 'John',
  4. values: [],
  5. };
  6.  
  7. <SettingBankAccount { ...{ ...props, values: ['dd'] } } />
  8.  
  9. // Better:
  10. const defaultProps = {
  11. name: 'John',
  12. values: [],
  13. };
  14.  
  15. const props = {
  16. ...defaultProps,
  17. values: ['dd'],
  18. }
  19.  
  20. <SettingBankAccount { ...props } />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement