Skip to content

Unclear data flow #91

Description

@arthur31416

When reading the code here

const deleteGoal = (goalId) => {

I had the impression the whole deletion logic was handled there.

Only a side effect (updating the local state) was done there.

Two issues:

  1. a minor one is the confusion between delete and onDelete which is lost halfway through components
  2. unclear separation of concerns. GoalItem happens to know a lot more than it probably should. It could be a simple UI component that accepts a delete function that is defined in the parent component Dashboard and that handles everything including the react state update

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions