score:2

you should have no issues with using react element array as the input to usestate. but, whenever you initialize your state with props coming from parent, you also need to re-update your state once the prop from parent changes. otherwise it will point to the old state passed down from parent in the first pass. and the way to do that is to do a setitems with useeffect hook

useeffect(() => {
   setitems(props.items)
}, [props.items])

btw this will only check for the reference equality between the old and the new array, if you want to do deep comparison, you should probably be using something like use-deep-compare-effect

score:10

this is not really recommanded you better do it in the useeffect because props in initial state is an anti-pattern.

const [items, setitems] = usestate([]);


useeffect(() => {
    setitems(props.items);
  },[props.items]);

Related Query

More Query from same tag