score:0

const [master, setMaster] = React.useState([]);
const [filtered, setFiltered] = React.useState([]);

React.useEffect(() => {
  makeApiCall().then(response => {
    setMaster(response);
    setFiltered(response);
  });
}, []);

function filterData() {
  setFiltered(master.filter(n => n.name === 'valueFromTextInput' && n.age === 'valueFromTextInput'));
}

Related Query

More Query from same tag