import "./App.css"; import { Routes, Route } from "react-router-dom"; import Menu from "./components/menu"; import CreateNote from "./pages/create"; import Save from "./pages/save-local"; import Publish from "./pages/publish"; import Note from "./pages/note"; import Notes from "./pages/notes"; import PubNote from "./pages/pubNote"; import PubError from "./pages/pubError"; import PubNoteSafe from "./pages/pubNoteSafe"; import RenderMarkdown from "./components/markdown"; import { io } from "socket.io-client"; function App() { Storage.prototype.setObj = function (key, obj) { return this.setItem(key, JSON.stringify(obj)); }; Storage.prototype.getObj = function (key) { return JSON.parse(this.getItem(key)) || {}; }; const socket = io(); function onConnect() { console.log("connect"); } function onDisconnect() { console.log("disconnect"); } function onFooEvent(value) { console.log("foo event", value); } socket.on("connect", onConnect); socket.on("disconnect", onDisconnect); socket.on("foo", onFooEvent); return (