What's a better way to handle this?
Solution
In our demo project we created a separate function in the resource and called it from whatever component that changed value. Difficult to copy paste from my phone so providing the screenshot.

TextInput::make('quantity')->numeric()->required()->live(onBlur: true)
->afterStateUpdated(fn(Set $set, Get $get, ?int $state) => $set('total_cost',
$state * $get('quantity') * (1 + $get('tax') / 100))),
TextInput::make('tax')->numeric()->suffix('%')->required()->live(onBlur: true)
->afterStateUpdated(fn(Set $set, Get $get, ?int $state) => $set('total_cost',
$state * $get('quantity') * (1 + $get('tax') / 100))),
TextInput::make('unit_cost')->numeric()->suffix('USD')->required()->live(onBlur: true)
->afterStateUpdated(fn(Set $set, Get $get, ?int $state) => $set('total_cost',
$state * $get('quantity') * (1 + $get('tax') / 100))),
TextInput::make('total_cost')->numeric()->suffix('USD')->required()->disabled(),