Skip to content

Refactor: Remove Login and Register Context #229

Description

@rcamach7

Why?

  • These are defined as context at the top level of the app that will:
    • cause re renders anytime a form input changes when user is logging in / registering
    • cause performance issues due to large amounts of input changes that cause re renders
  • Encapsulate the sign in and sign up functionality into their respective form components

How?

  • Login and Register components should track their own input via states defined in that same component
    • create handler functions that update this state when input changes
    • on submission, make sure that these new states and their values are being used instead of the old context
    • remove all imports and lines related to old files
  • Delete LoginContext and RegisterContext files
    • Delete all imports from these files wherever they exist
    • Delete these contexts from App.js file
  • Update ResponsiveAppBar component
    • Right now it uses the isLoggedIn value from the LoginContext. Use UserContext instead and check for the truthly value of user to check if user is logged in / exists.
  • Search for additional usages of these contexts and make appropriate updates (feel free to ask questions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions