There are several points to be covered here:
Array and object equality testing
Arrays & Objects will often (re-)trigger a useEffect even if they have not changed. The reason for this is that Javascript is not capable of assessing equality on such structures. Consider these two:
["a", "b"] === ["a", "b"] // <-- false
{a: "a", b: "b"} === {a: "a", b: "b"} // <-- also false
If the nesting in your serviceInstance is relatively shallow, you could manually decide which values should in fact trigger a refresh.
You mention serviceInstance is an array, so perhaps something like:
const [prop1, _, prop3] = serviceInstance;
useEffect(() => {
// code
}, [prop1, prop3])
Another solution is to use a deep compare useEffect variant, something like:
https://github.com/kentcdodds/use-deep-compare-effect
Please note though, as Dan Abramov himself states, there's a reason why useEffect doesn't work that way. Depending on how your data is structured, this can really create a bottleneck in the performance of your app.
Side effects
As Alia pointed out in the comments, if one of the setters in your effect actually ends up changing the contents of serviceInstance it will create a loop.
You should consider separating concerns:
When the contractParams change, one useEffect will set the params. You can then use a second useEffect that only looks at serviceInstance (or as seen above, parts of it) to then trigger a refresh.
import uuid from "uuid";
const [componentKey, setComponentKey] = useState(uuid())
const { contractParams, serviceInstance } = entityStore;
const [first, second, third, fourth] = getParamDetails(contractParams);
useEffect(() => {
setFirst(first);
setSecond(second);
setThird(third);
setFourth(fourth);
}, [first, second, third, fourth]);
const [prop1, _, prop3] = serviceInstance;
useEffect(() => {
// refresh code
setComponentKey(uuid());
},[prop1, prop3]);
return <YourComponent key={componentKey}/>
using something like https://www.npmjs.com/package/uuid to manage your uuid
Please note the above code is purely theoretical, as I do not know how you intend to use these values. If serviceInstance is being used in the render part of your component, then it should trigger a refresh on its own. You may need to rethink the structure of said component.
Edit: Dependencies on hooks
As a side note, depending on the strictly your react linter is set to enforce (eg: react-hooks/exhaustive-deps), using variables that are not used within the hook will throw a warning. This is usually a good sign that something is structurally wrong with the code.