Skip to content

Some Notes #30

Description

@klaw772

Hey Team,

I did a bit of debugging, and it looks like the fix to get your app back to a working state in-browser is pretty straightforward.

Take a look at your Form.js component. handleChange on line 12 takes in a parameter called 'event' that assumes that it has a .target.value or .target.name on it. But looking on lines 30, 38, 46, 54, and 60, these are taking in strings, not the JS event that is given from onChange. See about changing each of these onChanges to something like {(e) => handleChange(e)}. This will then have properties on it such as .target.value and .target.name that you're using in the handleChange function!

onSubmit still does not work, but that's because it's being passed in as a prop on line 3 of Form.js, but its value is not being defined when Form is actually used as a child component on line 132 in App.js. You'd need something like <Form onSubmit={addItem} /> in App.js, because that looks like the function where you're calling the POST request to the database.

Please let me know if this helps. Let's check in as a team to see how things are going and see how to wrap this project up strong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions