Function useDiagnostics

React hook: the current diagnostics, re-rendering on every change.