Class field methods don't work

This works:

const ExampleView = class extends ItemView {
  getViewType() {return "type"};
}

while this doesn’t:

const ExampleView = class extends ItemView {
  getViewType = () => "type";
}

and errors with this:

Uncaught (in promise) TypeError: n.getViewType is not a function
    at GraphView.t [as constructor] (app.js:1:1307315)
    at new t (app.js:1:1309847)
    at new ExampleView (example-view.js:24:3)
    at eval (main.mjs:56:14)
    at t.<anonymous> (app.js:1:2179953)
    at app.js:1:239667
    at Object.next (app.js:1:239772)
    at app.js:1:238688
    at new Promise (<anonymous>)
    at g (app.js:1:238433)

Why?

I don’t know how to edit posts here…ignore the “GraphView” in the error log, it should just be “ExampleView” as well.