JSFiddle - React, Tailwind, and code Playground

by Ryan Brackett

JavaScript

$(document).ready(function() {
        var inDesignMode = document.forms[MSOWebPartPageFormName].MSOLayout_InDesignMode.value;

        if (inDesignMode == "1") {
          console.log("EDIT MODE");
          $("body").addClass("edit-mode");
        } else {
          console.log("BROWSE MODE");
          $("body").addClass("browse-mode");
        }
      });