BlvckYuppie/authApp

Stuff's broke, yo.

Closed this issue · 4 comments

I see the problems you mention in your readme. Can you show me where that is in your codebase?

Also, I don't actually know React, but I sure know JavaScript so that may be enough.

Never mind, I'm stupid, you put the location in the readme.

Have you tried not using destructuring syntax? First thing I'd want to do is console.log(this.props.fields) here to see what's inside it.

This is what I'm getting for the value of this.props:

{
	"anyTouched": false,
	"asyncValidating": false,
	"dirty": false,
	"form": "login",
	"initialized": false,
	"invalid": false,
	"pristine": true,
	"submitting": false,
	"submitFailed": false,
	"submitSucceeded": false,
	"valid": true,
	"pure": true,
	"fields": ["email", "password"],
	"array": {}
}

This line is problematic:

var {email,password} = this.props.fields;

var {} = X works when X is an object.

var [] = X works when X is an array.

this.props.fields is an array — ["email", "password"] — not an object.

More info here.

Turns out, the version of redux-form I learned to use has a bunch of features that have been deprecated in the version of redux-form I npm installed.

Short term fix is to install an old version of redux-form, but in the real project this component's going to be used in, i'm going to re-write everything so that it's version compliant.