'Can I update the deps array in useEffect?

I am using Effect Hook and want to confirm if this implementation is correct. I am not getting any warning in the console but I want to know why this is not going into an infinite loop?

React.useEffect(() => {
    setSelections(inputUPC, false);
    //console.log(props.uncheckCard);
    props.setUncheckCard(false);
  }, [props.uncheckCard]);


Solution 1:[1]

It's not going into infinite loop because you only set this to false so there is no change in parameter (useEffect only trigger on dependencies values change)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kriss