Skip to content

A lot of states was used. Bind methods and the use of create react app #1

@abiodun0

Description

@abiodun0

Going through the code i saw you use states in almost all the components. There should be a difference and you should be able to use functional components when needed. there need to be some sort of communication between parent and child components.

Also using bind in the render method can lead to untimely performance issues as I've dropped in some of the comments.
Avoid forEach when you can and use map instead. where you used state.list could have been distrcuted to

(({list}) => {
const newList = list.map((todo) => ({...todo, isCompleted: showCompleted})
return {list: newList}
} ) 

I tell beginners to stay away from using create-react app. as

  1. it hides the complexity which isn't a good enough thing for beginners
  2. When it comes to auditing. using npm run eject gives about 500 lines of config files which is going to be a lot of hell trying to audit each lines of code
  3. you leave the maintain of your app to it's creators. which could turn to a huge technical debt.

The to-do app seem to be less challenging. why don't you try a game of tic-tac-toe instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions