I tried like this:
.onChange(of: sharedState.inputExpectedOutputPairInd) { inputExpectedOutputPairInd in
attached it to the view, but
got this error:
Value of optional type 'Int?' must be unwrapped to a value of type 'Int'
yes, it is optional, whatn can I do?