jimmylee / next-postgres-sequelize

[OUTDATED] React 16.8.4 + NextJS 8.0.3 + Emotion + Sequelize 5/Postgres + Passport Local Auth + Google App Engine or Heroku Deployment
https://next-postgres.herokuapp.com/
MIT License
181 stars 39 forks source link

Handling modal state #9

Closed jimmiejackson414-zz closed 5 years ago

jimmiejackson414-zz commented 5 years ago

I apologize if this is a question that is outside of the scope of this repo, but I'm just unable to find a solution and I'm hoping you can provide a little guidance!

I'm relatively new to the React world (coming from Rails). I've used your next-postgres repo as a guide and altered what I need to fit my app. I'm working on creating a signup modal using Material-UI, however when I hit the Submit button, I get an error: Unhandled Rejection (TypeError): Cannot read property 'toLowerCase' of undefined

This error is in http.js (line 166), where none of the information is being passed through to the signup method.

I have state set in the parent component (just to check whether the modal is open), and I have state set in the modal component to capture form values. When I console state in the modal component however, it only returns the parent state instead of modal state, which would be the issue back over in http.js.

Do you have any tips or guidance as to how to handle this? Feel free to remove this question if this isn't a good place for a question like this.

jimmiejackson414-zz commented 5 years ago

Well I'm an idiot. I had something inside of my render function that was overwriting state.

Thanks for creating such a a great starting point!