I’m almost done with the project, but I can’t add any thoughts. Deleting them is fine, but I don’t know what syntax errors I have that’s throwing me off.
Here’s the project:
And my code for AddThoughtForm.js:
import React, { useState } from ‘react’;
import { generateId, getNewExpirationTime } from ‘./utilities’;
export function AddThoughtForm(props) {
const [text, setText] = useState(’’);
const handleTextChange = (event) => {
setText(event.target.value)
}
const handleSubmit = (event) => {
event.preventDefault();
if (text.length > 0){
const thought = {
id: generateId(),
text: text,
expiresAt: getNewExpirationTime(),
};
props.addThought(thought);
setText('');
};
};
return (
);
}