發表文章

目前顯示的是 3月 15, 2019的文章

How to edit/update an object in an array and keep all other nested data?

圖片
2 1 I am trying to update purely just the firstName, lastName and profile for an object without destroying any other data within that object... Here's an example of the current state. state = { children: [ { id: 1, firstName: 'Bella', lastName: 'Laupama', profile: 'child_care', schedules: [ { id: 1, date: '25 December, 2018', parent: 'Chris', activity: 'Christmas' }, { id: 2, date: '28 December, 2018', parent: 'Mischa', activity: 'Christmas with Malane Whanau' }, { id: 3, date: '31 December, 2