$request->ajax() replacement

On Kirby 3.1.0 ist kirby()->request()->ajax() deprecated.
What is a good replacement to identify ajax requests on PHP?
And why is it a problem with the fetch API? If I understand it right it is more a reliable way to write AJAX requests in a promise style way instead of xhr.

There is no replacement, check out the issue report:

I also found this, it’s what Laravel is using instead, checking for the expected content header. You could create a similar custom method and make sure the correct header is sent with your request.

There are probably other ways, I suggest you google around a bit.