Skip to content

Instantly share code, notes, and snippets.

View kazuhiro4949's full-sized avatar

Kazuhiro Hayashi kazuhiro4949

View GitHub Profile
@marttp
marttp / App.js
Created February 9, 2020 05:06
Example of Server-Sent Events in Client (React)
import React, { useState } from "react";
import axios from 'axios';
import "./App.css";
export default function App() {
const [process, setProcess] = useState({});
const [message, setMessage] = useState({});
const [listening, setListening] = useState(false);
const statusMessage = {