Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.

Improvements to pages/auth/signin.js #31

Closed
iaincollins opened this issue Jun 7, 2017 · 1 comment
Closed

Improvements to pages/auth/signin.js #31

iaincollins opened this issue Jun 7, 2017 · 1 comment

Comments

@iaincollins
Copy link
Owner

Improve the componentDidMount() call in pages/auth/signin.js.

Avoid calling setState() in it if possible to avoid re-renders that at not really necessary and definitely don't call this.state directly, that's a typo.

It should look something like this:

  async componentDidMount() {
    const session = new Session()
    const latestSessionData = await session.getSession(true)
  }

The render() function may need to be changed to reference this.props rather than this.state.

@iaincollins iaincollins changed the title Improvements to sign in code Improvements to pages/auth/signin.js Jun 7, 2017
@iaincollins
Copy link
Owner Author

This has been refactored in the bootstrap branch (which I hope to merge into master soon).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant