I'm trying to create a new state by filtering out values from the current state.
// Create new state
const defaultState = [...this.state.defaultData];
newState = defaultState.filter(movies => !filteredItems.includes(movies.genre_ids));
I think my issue might be traversing into a sub object array as when I do this I just get a blank result.
Example JSON (I'm trying to filter by genre_ids:
Things I've already tried are hardcoding the values, which doesn't work. However I did try filtering by titles using the same method, and hardcoding the titles, which does work. Hence why I think maybe my traversing into genre_ids might be the issue?
I've created a stackblitz to show the current state of things: https://react-sxyyfp.stackblitz.io
Expected result is that when you check more than one checkbox, and then uncheck to remove that particular filter, the current active filters are still applied.