Skip to content

Conversion to use hooks needs more consideration. #660

Open
@dlech

Description

@dlech

Describe the bug
The conversion to hooks in #625 has caused unintentional breaking changes.

The use of useEffect is not a drop-in replacement of componentWillMount, componentDidMount, componentDidUpdate, etc. It is triggered at a different time, so things are in different states which leads to bugs. The editorWillMount, editorDidMount, and editorWillUnmount callbacks probably need to be reconsidered to match the new semantics of useEffect.

To Reproduce
One example is caught by our CI on an automatic depdendabot update.

https://github.com/pybricks/pybricks-code/actions/runs/3576716352/jobs/6014862442

Expected behavior
Breaking changes should come with a major version bump and a migration guide.

Screenshots/Logs
If applicable, add screenshots or logs to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. Linux]

  • Browser [e.g. Firefox, Safari]

  • Bundler [e.g. webpack]

  • I will try to send a pull request to fix this issue.

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