title: 'express' is not defined no-undef
body: <p>I was implementing a websocket chat server for my full stack web app and came to realisation that most of the sources out there only provide tutorial for html+js and I'm not exactly sure of how to migrate over from JS to JSX. </p>
  
  <p>I started trying to integrate the js codes into my jsx chat component file but came across with the issue that the <code>express() is undefined</code></p>
  
  <p>Here's my JS to establish the express server:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var server = require('http').createServer(app);
  var io = require('socket.io').listen(server);
  
  uses = [];
  connections = [];
  
  server.listen(process.env.port || 3000);
  console.log('server running...');
  </code></pre>
  
  <p>Here's my attempt to do it in JSX:</p>
  
  <pre><code>import React, { Component } from "react";
  
  class ChatComponent extends Component {
  
    state = { 
      express: require('express'),
      app: express(),
      server: require('http').createServer(this.app),
      io: require('socket.io').listen(this.server),
      users: [],
      connections: [],
    }
  
    render() {
      return (
        &lt;React.Fragment&gt;
        ...
  </code></pre>
  
  <p>When I try npm start it, i get this message, but no idea of how to fix it:</p>
  
  <pre><code>./src/components/chat/ChatComponent.jsx
    Line 7:  'express' is not defined  no-undef
  </code></pre>
  
  <p>I have also included the express and socket.io dependencies in my package.json and npm update it as well</p>
  
  <pre><code>{
    "name": "javlet-app",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
      "axios": "^0.19.0",
      "bootstrap": "^4.3.1",
      "express": "*",
      "jquery": "^3.4.1",
      "js-cookie": "^2.2.1",
      "popper.js": "^1.15.0",
      "react": "^16.9.0",
      "react-dom": "^16.9.0",
      "react-google-login": "^5.0.5",
      "react-new-window": "^0.1.2",
      "react-scripts": "3.0.1",
      "react-webcam": "^3.0.1",
      "socket.io": "*",
      "typescript": "^3.6.3",
      "uws": "^10.148.1",
      "yarn": "^1.17.3"
    },
    "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "eject": "react-scripts eject",
      "test": "jest --coverage"
    },
   ...
  </code></pre>
  
  <p>Any advice would be appreciated.
  More code can be provided if needed. Thanks</p>