title: React.Js: Elements in Components are not interactive after deployment
body: <p>My front end works fine on my localhost, everything works as it should. All elements are interactive and clickable. However after deployment parts of my app can not be interacted with. My header component sometimes works depending on which page is rendered. However my component UpdateCourse which is full of inputs and textareas cant be interacted with at all. This is true when using both github pages and netlify. I am using HashRouter instead of BrowserRouter. I've run out of ideas on trying to make them work. Thanks for your time :)</p>
  <pre><code>import React, { Component } from &quot;react&quot;;
  import { NavLink } from &quot;react-router-dom&quot;;
  import Data from &quot;../Data&quot;;
  
  
  export class UpdateCourse extends Component {
    constructor(props) {
      super(props);
      this.data = new Data();
  
      this.state = {
        authenticatedUser: this.state,
        emailAddress: &quot;&quot;,
        password: &quot;&quot;,
        userId: &quot;&quot;,
        title: &quot;&quot;,
        description: &quot;&quot;,
        estimatedTime: &quot;&quot;,
        materialsNeeded: &quot;&quot;,
        id: &quot;&quot;,
        errors: [],
      };
  
      this.handleSubmit = this.handleSubmit.bind(this);
      this.handleChange = this.handleChange.bind(this);
    }
  
    componentDidMount() {
      // Sets the id state to the course id
  
      const paramsId = this.props.match.params.id;
      const parsedId = parseInt(paramsId);
  
      this.setState({
        id: parsedId,
      });
  
      // Setting the email address and password to the authenticated user
  
      const { context } = this.props;
      const authedUser = context.authenticatedUser;
      const emailAddress = authedUser.emailAddress;
      const password = authedUser.password;
  
      this.setState({
        emailAddress: emailAddress,
        password: password,
      });
  
      // Using the rest api get method to retrieve the course based on the course id
  
      context.data
        .getCoursesById(parsedId)
        .then((response) =&gt; {
          if (response) {
            console.log(&quot;True&quot;);
            this.setState({
              title: response.course.title,
              description: response.course.description,
              estimatedTime: response.course.estimatedTime,
              materialsNeeded: response.course.materialsNeeded,
              userId: response.course.userId,
            });
          }
        })
        .catch((error) =&gt; {
          console.log(&quot;Course does not exists&quot;, error);
        });
    }
  
    // Takes the value from each text box or input and sets the state to the value of the corresponding name
  
    handleChange = (event) =&gt; {
      const target = event.target;
      const value = target.value;
      const name = target.name;
      this.setState({
        [name]: value,
      });
    };
  
    handleSubmit = (event) =&gt; {
      const { context } = this.props;
  
      // Takes the state of each value needed to authenticate a PUT request from the Rest Api.
  
      const {
        userId,
        title,
        description,
        estimatedTime,
        materialsNeeded,
      } = this.state;
  
      // Creates a new object with each property as the value of each corresponding state
  
      const updatedCourse = {
        userId,
        title,
        description,
        estimatedTime,
        materialsNeeded,
      };
  
      const { emailAddress, password } = this.state;
      const { id } = this.state;
  
      const paramsId = this.props.match.params.id;
      const parsedId = parseInt(paramsId);
  
      event.preventDefault();
  
      // The PUT request is made if title and description are not empty
      // PUT request requires the id of the course as well as the user email and password to make a change.
  
      context.data
        .updateCourse(id, updatedCourse, emailAddress, password)
        .then((errors) =&gt; {
          if (errors.length) {
            this.setState({ errors });
            console.log(errors);
          } else if (this.state.description !== &quot;&quot; || this.state.title !== &quot;&quot;) {
            this.props.history.push(`/courses/${parsedId}`);
          }
        })
        .catch((error) =&gt; {
          console.log(error);
        });
    };
  
    render() {
      const { context } = this.props;
      const authedUser = context.authenticatedUser;
  
      const paramsId = this.props.match.params.id;
      const parsedId = parseInt(paramsId);
  
      let errorList;
  
      if (this.state.errors.length) {
        errorList = this.state.errors.map((error, index) =&gt; {
          return (
            &lt;p className=&quot;create-div-validations&quot; key={index}&gt;
              {error}
            &lt;/p&gt;
          );
        });
      }
  
      return (
        &lt;div&gt;
          &lt;h1 className=&quot;update-h1&quot;&gt; Update Course &lt;/h1&gt;
  
          &lt;form onSubmit={this.handleSubmit}&gt;
            {errorList}
            &lt;div className=&quot;update-div&quot;&gt;
              &lt;div className=&quot;update-div-left&quot;&gt;
                &lt;h3&gt;Course title&lt;/h3&gt;
                &lt;div&gt;
                  &lt;input
                    id=&quot;title&quot;
                    name=&quot;title&quot;
                    type=&quot;text&quot;
                    onChange={this.handleChange}
                    className=&quot;update-div-input&quot;
                    value={this.state.title}
                  &gt;&lt;/input&gt;
                &lt;/div&gt;
  
                &lt;p&gt;
                  By {authedUser.firstName} {authedUser.lastName}
                &lt;/p&gt;
                &lt;textarea
                  className=&quot;text-area-left&quot;
                  id=&quot;description&quot;
                  name=&quot;description&quot;
                  onChange={this.handleChange}
                  value={this.state.description}
                &gt;&lt;/textarea&gt;
              &lt;/div&gt;
              &lt;div className=&quot;update-div-right&quot;&gt;
                &lt;ul className=&quot;list-style-right&quot;&gt;
                  &lt;li&gt;
                    &lt;h4&gt;Estimated Time&lt;/h4&gt;
                    &lt;div&gt;
                      &lt;input
                        className=&quot;update-div-input-right&quot;
                        id=&quot;estimatedTime&quot;
                        name=&quot;estimatedTime&quot;
                        type=&quot;text&quot;
                        onChange={this.handleChange}
                        defaultValue={this.state.estimatedTime}
                      &gt;&lt;/input&gt;
                    &lt;/div&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                    &lt;h4&gt;Materials Needed&lt;/h4&gt;
                    &lt;div&gt;
                      &lt;textarea
                        className=&quot;text-area-right&quot;
                        id=&quot;materialsNeeded&quot;
                        name=&quot;materialsNeeded&quot;
                        onChange={this.handleChange}
                        defaultValue={this.state.materialsNeeded}
                      &gt;&lt;/textarea&gt;
                    &lt;/div&gt;
                  &lt;/li&gt;
                &lt;/ul&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div className=&quot;buttons&quot;&gt;
              &lt;button className=&quot;update-button&quot; type=&quot;submit&quot;&gt;
                Update Course
              &lt;/button&gt;
              &lt;NavLink className=&quot;update-button&quot; to={`/courses/${parsedId}`}&gt;
                Cancel
              &lt;/NavLink&gt;
            &lt;/div&gt;
            &lt;div id=&quot;tsparticles&quot; className=&quot;tsparticles&quot; /&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      );
    }
  }
  
  export default UpdateCourse;
  </code></pre>
  <pre><code>import React, { Component } from &quot;react&quot;;
  import { Link } from &quot;react-router-dom&quot;;
  import Data from &quot;../Data&quot;;
  
  export class Header extends Component {
    constructor(props) {
      super(props);
      this.data = new Data();
      this.state = {
        authenticatedUser: this.state,
      };
    }
  
    
  
    render() {
      const { context } = this.props;
      const authedUser = context.authenticatedUser;
  
      return (
        &lt;div&gt;
        &lt;div className=&quot;header-div&quot;&gt;
          &lt;div&gt;
            &lt;Link to=&quot;/&quot; className=&quot;header-div-left&quot;&gt;
              Student Courses
            &lt;/Link&gt;
          &lt;/div&gt;
          &lt;nav&gt;
            {authedUser ? (
              &lt;React.Fragment&gt;
                &lt;div className=&quot;header-div-right&quot;&gt;
                  &lt;span className=&quot;header-div-right&quot;&gt;
                    Welcome {authedUser.firstName} {authedUser.lastName}
                  &lt;/span&gt;
                  &lt;Link className=&quot;header-div-right&quot; to=&quot;/signout&quot;&gt;
                    Sign Out
                  &lt;/Link&gt;
                &lt;/div&gt;
              &lt;/React.Fragment&gt;
            ) : (
              &lt;React.Fragment&gt;
                &lt;div className=&quot;header-div-right-up-in&quot;&gt;
                  &lt;Link className=&quot;header-div-right&quot; to=&quot;/signup&quot;&gt;
                    Sign Up
                  &lt;/Link&gt;
                  &lt;Link className=&quot;header-div-right&quot; to=&quot;/signin&quot;&gt;
                    Sign In
                  &lt;/Link&gt;
                &lt;/div&gt;
              &lt;/React.Fragment&gt;
            )}
          &lt;/nav&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      );
    }
  }
  </code></pre>
  <pre><code>import React from 'react';
  import {
    HashRouter as Router,
    Route,
    Switch,
    Link
  } from 'react-router-dom';
  
  
  import './App.css';
  import CourseDetail from './components/CourseDetail';
  import Courses from './components/Courses';
  import CreateCourse from './components/CreateCourse';
  import Header from './components/Header';
  import UpdateCourse from './components/UpdateCourse';
  import UserSignIn from './components/UserSignIn';
  import UserSignOut from './components/UserSignOut';
  import UserSignUp from './components/UserSignUp';
  import NotFound from './components/NotFound';
  import PrivateRoute from './PrivateRoute';
  import withContext from './Context';
  
  //Connecting the SignUp &amp; SignIn to context.
  
  //This shares the data and actions throughout the component tree
  
  /* Adding the const's as the component to the route handler
  lets the components UserSignIn &amp; UserSignUp gain access to 
  the function in context and any data or actions passed into
  &lt;Context.Provider value={value}&gt; */
  
  const UserSignInWithContext = withContext(UserSignIn);
  const UserSignUpWithContext = withContext(UserSignUp);
  const UserSignOutWithContext = withContext(UserSignOut);
  
  /* To let the user know they are signed in
  need to make changes to the name display in the end header */
  
  const HeaderWithContext = withContext(Header);
  const CoursesWithContext = withContext(Courses);
  const CourseDetailsWithContext = withContext(CourseDetail);
  const UpdateCourseWithContext = withContext(UpdateCourse)
  const CreateCourseWithContext = withContext(CreateCourse)
  
  export default () =&gt; (
    
    &lt;Router&gt;
      &lt;div &gt;
      &lt;HeaderWithContext/&gt;
        &lt;Switch&gt;
          &lt;Route exact path=&quot;/&quot; component={CoursesWithContext} /&gt;
          &lt;PrivateRoute path=&quot;/courses/create&quot; component={CreateCourseWithContext} /&gt;
          &lt;Route exact path=&quot;/courses/:id&quot; component={CourseDetailsWithContext} /&gt;
          &lt;PrivateRoute path=&quot;/courses/:id/update&quot; component={UpdateCourseWithContext} /&gt;
          &lt;Route path=&quot;/signin&quot; component={UserSignInWithContext} /&gt;
          &lt;Route path=&quot;/signup&quot; component={UserSignUpWithContext} /&gt;
          &lt;Route path=&quot;/signout&quot; component={UserSignOutWithContext} /&gt;
          &lt;Route component={NotFound} /&gt;
        &lt;/Switch &gt;
      &lt;/div &gt;
    &lt;/Router&gt;
    
  );
  </code></pre>