Filtering props.userList for status filter button.

Hello Everyone.
We have a collection of repeating elements coming from the $props.userList prop. We also have a status filter button that should filter the users list. We want to filter the users list after the status filter action.
I tried to add an Interaction on change event and run code to filter $props.userList, but the original list was not saved and the filter did not work because the list is mutable.

So, how can we filter $props.userList? And how can we access event handlers in our Next.js codebase?
Also is this aproach good way, or we need to save users in state?

Hi, are you trying to have a button perform the filter? Or are you trying to filter based on some other input like a text input or select or checkboxes etc?

If the latter, then you just need to set your repetition to a dynamic value that looks something like this

$Props.userlist.filter u.name.includes $state.textinput1.value

If it needs any button, then you just need to also create a state variable of Boolean type, and then filter based on that

Apologies looks like my phone messed up all my typing, but let me know if that point you in the right direction, and if you’re still having trouble I can clarify the expression above once I’m back at keyboard