nico
Published in : 2022-02-18
Hello I need to filter props.arrayData with filtering in one functionnal component
export function BurnSegments({ arrayData }) { function handleChange(event) { event.preventDefault(); this.setState({ arrayData : arrayData .filter(b => b.key === event.target.value) }); }
But setState is undefined, so what is the proper way of changing arrayData in the props?
Thanks
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
nico Date : 2022-02-18
Best answers
4
Best answers
4
I made it work by using the useState of the functional component as we can't update props.
with the steps:
By the way I used redux here