Measurable Success «10 Checkpoints for Future-Proof Enterprise CMS» White Paper
Measurable Success - White Paper
New in 1.18.0

currentEditor()

Returns the current editor.

const currentEditor = await Scrivito.load(() => Scrivito.currentEditor());
Scrivito.currentEditor returns the logged editor with their ID, name and the teams they belong to.
Returns


An Editor instance if the user interface is present, otherwise null.

Remarks

Returns null while loading.

Example

const TeamCountNotification = Scrivito.connect(() => {
  const editor = Scrivito.currentEditor();

  if (editor && editor.teams().length > 15) {
    return <p>`You are a member of ${editor.teams().length} teams`</p>;
  }

  return null;
});