How to hide selected items using filter in react js?

I am having a list of items which appears in the popup when I select an option from the dropdown. The popup allows me to select items from it using checkboxes, so that the selected Option will be having the selected items. I can see the selected elements even if I select them. Now I want to hide the selected items. I used filter condition for this.

() => this.exportService
                    .GetLogicalBlocksForSysController(blockInput)
                    .then((result) => {
                        let tagInfo = result.filter(x => this.props.selectedGridTags.filter(y => y.BlockID !== x.BlockID).length > 0 ? false : true );
                        this.setState(() => ({
                            allTags: tagInfo ? tagInfo : [],
                            tagLoadProgress: false,
                        }));
                       
                    })

selectedGridTags are the items that selected from the popup. I tried this approach, but it’s not hiding my items after selecting them,

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.