score:0

Accepted answer
 write another useeffect and put data dependency in an array and clean up second then in your useeffect becaucse that is unnesseary


  useeffect(() => {
     const olddtate=[...data]
     olddtate.foreach(element => {
      let options = [];
      if (options.indexof(element.category) < 0) options += { value: 
         element.category, label: element.category };
       setc_options(options) 
       }, [data])

Related Query

More Query from same tag