MergedContacts | Contact Viewer app for the Locker Project
kandi X-RAY | MergedContacts Summary
kandi X-RAY | MergedContacts Summary
Contact Viewer app for the Locker Project
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MergedContacts
MergedContacts Key Features
MergedContacts Examples and Code Snippets
Community Discussions
Trending Discussions on MergedContacts
QUESTION
I have two sets of data coming in from API, accountContacts & callReportContacts like so:
...ANSWER
Answered 2020-Aug-28 at 09:35You can take advantage of checked: true
on the data that is coming from the API. This data, you are already storing on the mergedContacts
- so you can use it as a flag if this object is initially checked. This will be used later on, on assessing whether or not to push to contacts
or deselectedContacts
.
With that said, I took a look at your ToggleOption
component, and it looks like you are already passing that object attribute as a prop named ischecked
, and furthermore, you are not mutating it - which makes the job easier.
What I did is I passed additional props to the ToggleOption
component, the deselectedContacts
state and the setDeselectedContacts
state setter. After that, on the onChange/onClick events of the ToggleOption
inputs, I passed along the ischecked
prop which would indicate if the contact was initially checked.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MergedContacts
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page