Skip to content

update form and to do list#2

Open
MichaelGarbuzov wants to merge 5 commits into
mainfrom
michaelgarbuzov
Open

update form and to do list#2
MichaelGarbuzov wants to merge 5 commits into
mainfrom
michaelgarbuzov

Conversation

@MichaelGarbuzov

Copy link
Copy Markdown
Owner

No description provided.

@Tamir198 Tamir198 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using css variables for repeating values (if you want to change some value you will have to change it in all the places the color is used).

Please be consistent with your component name.
for example, change form.js to Form.js

Improvement idea - don't let your user add empty TODO.

Comment thread src/App.js
Comment thread src/App.js
export const ThemeContext = createContext("null");

function App() {
const [inputText, setInputText] = useState("");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need this state? you are only using it to set the value in the form to be "". Why not init the form value to "" ?

Comment thread src/App.js

function App() {
const [inputText, setInputText] = useState("");
const [todos, setTodos] = useState([]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant this state sit inside ToDoList.js ? Do you need it inside App.js

Comment thread src/components/form.js

const Form = ({ setInputText, todos, setTodos, inputText }) => {
const inputTextHandler = (e) => {
console.log(e.target.value);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't leave non used comments and prints

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants